import numpy as np

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

print((len(np.base_repr(N,K))))   
N,K = list(map(int,input().split()))

a = N

ans = []

solve = ""

while a>=K:

  ans.append(a%K)

  a = a//K

ans.append(a)

print((len(ans)))
import numpy as np

N, K = list(map(int, input().split()))
print((len(np.base_repr(N, K))))

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

-import numpy as np - -print((len(np.base_repr(N, K)))) +a = N +ans = [] +solve = "" +while a >= K: +    ans.append(a % K) +    a = a // K +ans.append(a) +print((len(ans)))