def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out
 
N, K = map(int, input().split())
N = from_10_to_n(N, K)
print(len(N)) def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out
  from_10_to_n tmp = x tmp x out = '' out '' while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
   tmp > 0 tmp 0 out = str(x % n) + out out str(x % n) + out str(x % n) str x % n x n out tmp = tmp // n tmp tmp // n tmp n return out out x x n n N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K N = from_10_to_n(N, K) N from_10_to_n(N, K) from_10_to_n N K print(len(N)) print len(N) len N N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K N = from_10_to_n(N, K) from_10_to_n(N, K) N def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out
  def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out
  from_10_to_n
def from_10_to_n(x, n):
  tmp = x
  out = ''
  while tmp > 0:
    out = str(x % n) + out
    tmp = tmp // n
  return out
 
N, K = map(int, input().split())
N = from_10_to_n(N, K)
print(len(N))