n,k = map(int,input().split())
def base10to(n, k):
  if(int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
  return str(n%k)
print(len(base10to(n,k))) n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k def base10to(n, k):
  if(int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
  return str(n%k) base10to if(int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
   int(n/k) int n/k n k return base10to(int(n/k), k) + str(n%k) base10to(int(n/k), k) + str(n%k) base10to(int(n/k), k) base10to int(n/k) int n/k n k k str(n%k) str n%k n k return str(n%k) str(n%k) str n%k n k n n k k print(len(base10to(n,k))) print len(base10to(n,k)) len base10to(n,k) base10to n k def base10to(n, k):
  if(int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
  return str(n%k) def base10to(n, k):
  if(int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
  return str(n%k) base10to k = map(int,input().split()) map(int,input().split()) k n,k = map(int,input().split()) map(int,input().split()) n
n,k = map(int,input().split())
def base10to(n, k):
  if(int(n/k)):
    return base10to(int(n/k), k) + str(n%k)
  return str(n%k)
print(len(base10to(n,k)))