n,k = map(int,input().split())
a = []
while n > 0:
  a.append(n % k)
  n //= k
print(len(a)) n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k a = [] a [] while n > 0:
  a.append(n % k)
  n //= k n > 0 n 0 a.append(n % k) a.append a append n % k n k n //= k n k print(len(a)) print len(a) len a k = map(int,input().split()) map(int,input().split()) k a = [] [] a n //= k k n n,k = map(int,input().split()) map(int,input().split()) n
n,k = map(int,input().split())
a = []
while n > 0:
  a.append(n % k)
  n //= k
print(len(a))