n,k=map(int,input().split())
total=[]

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

while True:
    if n>=k:
        total.append((n%k))
        n=n//k
    if n<k:
        total.append((n))
        break
print(len(total))