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