def Base(X, n):
    if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
    return str(X%n)

def main():
  N, K = map(int, input().split())
  ans1 = Base(N, K)
  ans = len(ans1)
  print(ans)

main() def Base(X, n):
    if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
    return str(X%n) Base if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
     int(X/n) int X/n X n return Base(int(X/n), n)+str(X%n) Base(int(X/n), n)+str(X%n) Base(int(X/n), n) Base int(X/n) int X/n X n n str(X%n) str X%n X n return str(X%n) str(X%n) str X%n X n X X n n def main():
  N, K = map(int, input().split())
  ans1 = Base(N, K)
  ans = len(ans1)
  print(ans) main N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K ans1 = Base(N, K) ans1 Base(N, K) Base N K ans = len(ans1) ans len(ans1) len ans1 print(ans) print ans main() main def Base(X, n):
    if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
    return str(X%n) def Base(X, n):
    if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
    return str(X%n) Base def main():
  N, K = map(int, input().split())
  ans1 = Base(N, K)
  ans = len(ans1)
  print(ans) def main():
  N, K = map(int, input().split())
  ans1 = Base(N, K)
  ans = len(ans1)
  print(ans) main
def Base(X, n):
    if (int(X/n)):
        return Base(int(X/n), n)+str(X%n)
    return str(X%n)

def main():
  N, K = map(int, input().split())
  ans1 = Base(N, K)
  ans = len(ans1)
  print(ans)

main()