object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N, K = sc.nextInt()
  @scala.annotation.tailrec
  def loop(m: Int, count: Int): Int = if (N / m == 0) count else loop(m * K, count + 1)
  println(loop(K, 1))
}
