n, k = list(map(int, input().split()))

ans = 1

while n >= k:

    ans += 1

    n = n // k



print(ans)
n, k = list(map(int, input().split()))

ans = 0

while n > 0:

    ans += 1

    n = n // k



print(ans)
n, k = list(map(int, input().split()))
ans = 1
while n >= k:
    ans += 1
    n = n // k
print(ans)

n, k = list(map(int, input().split()))
ans = 0
while n > 0:
    ans += 1
    n = n // k
print(ans)

-ans = 1 -while n >= k: +ans = 0 +while n > 0: