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

i = 0
anslist = []
while True:
  if N>=K:
    i+=1
    anslist.append(N%K)
    N = N//K
    #print (N)
  if N<K:
    anslist.append(N)
    i+=1
    break
    
anslist.reverse()
#print (anslist)
#print (''.join(map(str, anslist)))
print (i) N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K i = 0 i 0 anslist = [] anslist [] while True:
  if N>=K:
    i+=1
    anslist.append(N%K)
    N = N//K
    #print (N)
  if N<K:
    anslist.append(N)
    i+=1
    break
     True if N>=K:
    i+=1
    anslist.append(N%K)
    N = N//K
    #print (N)
   N>=K N K i+=1 i 1 anslist.append(N%K) anslist.append anslist append N%K N K N = N//K N N//K N K if N<K:
    anslist.append(N)
    i+=1
    break
     N<K N K anslist.append(N) anslist.append anslist append N i+=1 i 1 break anslist.reverse() anslist.reverse anslist reverse print (i) print i K = map(int,input().split()) map(int,input().split()) K N,K = map(int,input().split()) map(int,input().split()) N i+=1 1 i N = N//K N//K N i = 0 0 i i+=1 1 i anslist = [] [] anslist
N,K = map(int,input().split())

i = 0
anslist = []
while True:
  if N>=K:
    i+=1
    anslist.append(N%K)
    N = N//K
    #print (N)
  if N<K:
    anslist.append(N)
    i+=1
    break
    
anslist.reverse()
#print (anslist)
#print (''.join(map(str, anslist)))
print (i)