object Main extends App {
	val sc = new java.util.Scanner(System.in)
	val pw = new java.io.PrintWriter(System.out)
	
	@scala.annotation.tailrec
	def f(n: Int, k: Int, r: Int): Int =
		if (n < k) r + n.toString.size else f(n / k, k, r+1)

	pw.println(f(sc.nextInt, sc.nextInt, 0))
	pw.flush()
}