n, k = map(int, input().split())
if n < k:
    print(1)
    exit()
v = []
while True:
    x = n % k
    n //= k
    v.append(x)
    if n < k:
        v.append(n)
        break
print(len(v)) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k if n < k:
    print(1)
    exit() n < k n k print(1) print 1 exit() exit v = [] v [] while True:
    x = n % k
    n //= k
    v.append(x)
    if n < k:
        v.append(n)
        break True x = n % k x n % k n k n //= k n k v.append(x) v.append v append x if n < k:
        v.append(n)
        break n < k n k v.append(n) v.append v append n break print(len(v)) print len(v) len v k = map(int, input().split()) map(int, input().split()) k n, k = map(int, input().split()) map(int, input().split()) n n //= k k n v = [] [] v x = n % k n % k x
n, k = map(int, input().split())
if n < k:
    print(1)
    exit()
v = []
while True:
    x = n % k
    n //= k
    v.append(x)
    if n < k:
        v.append(n)
        break
print(len(v))
