import queue
N,K = map(int,input().split())
ans = queue.Queue()
while N >= K:
    N,amari = divmod(N,K)
    ans.put(amari)
ans.put(N)
answer = ""
while not ans.empty():
    answer += str(ans.get())
print(len(answer)) import queue queue N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K ans = queue.Queue() ans queue.Queue() queue.Queue queue Queue while N >= K:
    N,amari = divmod(N,K)
    ans.put(amari) N >= K N K N,amari = divmod(N,K) N divmod(N,K) divmod N K amari ans.put(amari) ans.put ans put amari ans.put(N) ans.put ans put N answer = "" answer "" while not ans.empty():
    answer += str(ans.get()) not ans.empty() ans.empty() ans.empty ans empty answer += str(ans.get()) answer str(ans.get()) str ans.get() ans.get ans get print(len(answer)) print len(answer) len answer N,K = map(int,input().split()) map(int,input().split()) N answer += str(ans.get()) str(ans.get()) answer K = map(int,input().split()) map(int,input().split()) K amari = divmod(N,K) divmod(N,K) amari ans = queue.Queue() queue.Queue() ans answer = "" "" answer N,amari = divmod(N,K) divmod(N,K) N
import queue
N,K = map(int,input().split())
ans = queue.Queue()
while N >= K:
    N,amari = divmod(N,K)
    ans.put(amari)
ans.put(N)
answer = ""
while not ans.empty():
    answer += str(ans.get())
print(len(answer))