N,K=map(int, input().split())

list=[]
while N>=K:
    x=N%K
    N=N//K
    list.append(x)

list.append(N)
print(len(list)) N,K=map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K list=[] list [] while N>=K:
    x=N%K
    N=N//K
    list.append(x) N>=K N K x=N%K x N%K N K N=N//K N N//K N K list.append(x) list.append list append x list.append(N) list.append list append N print(len(list)) print len(list) len list N,K=map(int, input().split()) map(int, input().split()) N K=map(int, input().split()) map(int, input().split()) K list=[] [] list x=N%K N%K x N=N//K N//K N
N,K=map(int, input().split())

list=[]
while N>=K:
    x=N%K
    N=N//K
    list.append(x)

list.append(N)
print(len(list))
