System.in.eachLine{{a,b->printf"%.0f\n",Math.log(a)/Math.log(b)}it.split()*.toDouble()}