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