peterverebics/CodeNet_Python_118 huggingface dataset:
import math

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

a = math.log(N+1,K)
b = math.log(N,K) + 1

#print(a)
#print(b)

a1 = math.ceil(a)
b1 = math.floor(b)

#print(a1)
#print(b1)

if a.is_integer():
    print(int(a))
elif b.is_integer():
    print(int(b))
else:
    print(a1)
#!/usr/bin/env python3
n, m = map(int, open(0).read().split())
for i in range(n):
    if n // (m**i) == 0:
        print(i)
        quit()
N,K= map(int, input().split())
A = 0
cnt = -1
if N == 0:
    print(1)
else:
    while N >= A:
        cnt += 1
        A = K**(cnt+1)-1
        print(A)
    print(cnt+1)
n,k=map(int,input().split())
i=0
while (n>1):
    n/=k
    i+=1
    
print(i)
i,n = map(int,input().split())
aaa = i // n
ans = 1
while aaa >= n:
  aaa = aaa // n
  ans = ans + 1
print(ans)
n, k = map(int, input().split())
x = k
ans = 1
while n > x:
    x *= k
    ans += 1

print(ans)
import sys
n,k=map(int,input().split())
for i in range(10):
  if k**i<=n and n<k**(i+1):
    print(i+1)
    sys.exit()
n, k = map(int, input().split())
x = 1
ans = 0
while x < n:
    x *= k
    ans += 1
print(ans)
N, K = map(int, input().split())

count = 0
N_K = 1
while N > N_K:
    count += 1
    N_K *= K

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

def ans156(N:int, K:int):
    count=1
    while True:
        N=int(N/K)
        count+=1
        if N<K:
            break
    return count

print(ans156(N,K))
n, k = map(int, input().split())
for i in range(n):
    if n <= k**i:
        print(i)
        break
# coding:utf-8

N, K = map(int, input().split(' '))
digit = K
cnt = 1

while digit < N:
    digit *= K
    cnt += 1

print(cnt)
N, K = map(int, input().split())
N_ = N
num = 1
while N > K:
    N = N//K
    num +=1

list = []

for i in range(num, -1, -1):
    n = str(N_//(K**i))
    N_ = N_ % (K**i)
    # print(N_, n)
    list.append(n)

print(len(list))
a,b=input().split()
a=int(a)
b=int(b)
c=b
i=1
while a>c:
    c=c*b
    i+=1
print(i)
n,k = map(int,input().split())
a = 1
for i in range(100000000000):
  n =  n//k
  a +=1
  if(n<k):
    break
print(a)
N,K=map(int,input().split())

result = " "
while N > 1:
    result = str(N % K) + result
    N //= K

result = str(N % K) + result
print(result)
n, k = map(int, input().split())
cnt = 0
while True:
    if n-k**cnt <= 0:
        print(cnt)
        break
    cnt += 1
N,K = map(int,input().split())
N =+ 1
ans = 1
for i in range(1000000): 
	if K**(ans) < N:
		ans += 1
	else:
		print(ans)
		break
n, k = map(int, input().split())
temp = 1

for i in range(2**30):
    # if k ** (i - 1) - 1 < n <= k ** i - 1:
    # print(i, temp)
    temp *= k
    if n <= temp:
        print(i + 1)
        exit()
import numpy as np
n, k = map(int, input().split())


def log(r, d):
    return np.log(d)/np.log(r)


print(int(np.ceil(log(k, n))))
import math

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

print(math.ceil(math.log(N, K)))
n,k=map(int,input().split())

ans=0
inc=1
while inc < n:
  inc*=k
  ans+=1
print(ans)
i,n = map(int,input().split())
aaa = i // n
ans = 2
while aaa >= n:
  aaa = aaa // n
  ans = ans + 1
print(ans)
# input
N, K = map(int, input().split())

i = 1
while N <= K ** i:
    if N <= K ** i:
        i += 1

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

tmp = 1
ans = 0
while (tmp < N):
    tmp *= K
    ans += 1
print(ans)
import math

N, K = map(int, input().split())
print(math.ceil(math.log(N, K)))
N,K=map(int,input().split())
hey=N
ans=2
while hey//K >= K:
    ans += 1
    hey = hey//K
print(ans)
a,b=map(int,input().split())
i=2
while a//b>=b:
    a=a//b
    i+=1
print(i)
def main():
    n,k = map(int, input().split())
    
    ans = 1
    for j in range(100000):
        ans *= k
        if ans >= n:
            print(j+1)
            break

if __name__ == '__main__':
    main()
N, K = map(int, input().split())
ans = 1
tmp = 1

while N >= tmp:
    tmp = tmp * K
    ans += 1

print(tmp)
print(ans-1)
import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools

mod = int(1e9+7)
INF = 1<<29

def main():
    n,k = map(int,input().split())
    ans = 0
    if n % k != 0:
        ans = 1
    while n > 1:
        n //= k
        ans += 1
    print(ans)
    return

if __name__=='__main__':
    main()
import math
n,k = map(int, input().split())

print(int(math.ceil(math.log(n,k))))
from math import ceil, log

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

print(ceil(log(N, K)))
n,k=map(int,input().split())
x=n
count=0
while(x>1):
  x/=k
  count+=1
print(count)
n,k= map(int,input().split())
count =1
while n > k:
  n=n/k
  count+=1
print(count)
import math
n,k=map(int,input().split())

print(math.ceil(math.log(n,k)))
n,k=map(int,input().split())
x=str((n-1)%k+1)*(((n-1)//k)+1)
y=sum(list(map(int,x)))
print(y)
import math
n,k = map(int, input().split())

N = int(math.floor(math.log(n)/math.log(k)))+1
m = n
L = []
for i in range(N+1):
  L.append(m//(k**(N-i)))
  m = m%(k**(N-i))
  
if L[0] == 0:
  L.pop(0)

ANS = [str(L[i]) for i in range(len(L))]
print("".join(ANS))
n, k =list(map(int, input().split()))
l = []
while True:
    l.append(n % k)
    n = n // k
    if n // k == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)
#coding:utf-8
import math

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

t1 = math.ceil(math.log(n,k))

print("{}".format(t1))
x,y = map(int,input().split())

res = ''
count = 0
while y**count < x:
    count += 1
print(count)
i,n = map(int,input().split())
aaa = i // n
ans = 2
while aaa >= n:
  aaa = aaa / n
  ans = ans + 1
print(ans)
import math
N,K = map(int,input().split())
print(math.ceil(math.log(N,K)))
n, k = map(int, input().split())

ans = 1
while (n > k):
    n /= k
    ans += 1

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

out = []
while 1:
  if N == 0:
    out.append(0)
    break
  else:
    out.append(N%K)
    N = int(N/K)
    if N <= K-1:
      out.append(K-1)
      break
#print(out)
print(len(out))
import math
N, K = map(int, input('').split(' '))
print(int(-(-math.log(N, K) // 1)))
N, K = map(int,input().split())

counter = 0
while N >= K:
    N = N/K
    counter = counter + 1

print(counter)
N, K = map(int, input().split())
ans = 0
while N > 0:
  N /= K
  ans += 1
print(ans)
N, K = map(int, input().split())
count = 0

while N > K ** count:
  count += 1

print(count)
# -*- coding: utf-8 -*-
import math

n, k = map(int, input().split())
result = math.log(n+1, k)
print(math.ceil(result))
n, k = map(int, input().split())
i = 1
while k**i < n:
    i += 1
print(i)
N,K = map(int, input().split())

Sum = 1

while True:
    Sum += 1

    if K ** Sum > N:
        break

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

x = 0

for j in range(1, 46):
    if N > (K**j):
        continue
    else:
        print(j)
        break
n, k = map(int, input().split())
ans = 0
for i in range(1, n+1):
    if n <= k**i:
        ans = i
        break

print(ans)
N, K = map(int, input().split())
count = 1
while N > K**count:
    count += 1
print(count)
N,K=map(int,input().split())
counter=0
mem=1
while N > mem:
    mem=K*mem
    counter+=1
print(counter)
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if N == 1:
        ans = 1
        break
    elif K==10&N==10:
        ans = 2
        break
    elif N <= K:
        ans = 1
        break
    elif K**i < N:
        i += 1
    else :
        ans = i
        break
print(ans)
N,R=map(int,input().split())
for i in range(N):
	if R**i>N:
		print(i)
		break
N, K = map(int, input().split())

total = 0

while True:
    v, m = divmod(N, K)
    total += 1
    if v < K:
        total += 1
        break
    else:
        N = v

print(total)
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy


#X = str(input()).split()
#a = [int(x) for x in input().split()]


NK = str(input()).split()
N = int(NK[0])
K = int(NK[1])
ans = 0

for i in range(N):
  if(N<=K**i):
    ans = i
    break

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

i=0
a=[]
if K==10:
    print(len(str(N)))
else:
    while N>=K**i:
        i+=1
    i-=1
    for j in range(i+1):
        a.append(N//(K**(i-j)))
        N%=(K**(i-j))
        
    print(a)
n,k=map(int,input().split())
cnt=1
ans=0
if k>=n:
 print(1)
else:
 while n>cnt:
  ans+=1
  cnt*=k
print(ans)
N, K = map(int, input().split()) 
ans = 1
while(True):
    N = N // K
    ans += 1
    if(N<K):
        break
print(ans)
from math import log, ceil

N, K = map(int, input().split())
if N %K==0:
  	print(log(N,K)//1)
else:
	print(ceil(log(N, K)))
N, K = list(map(int,input().split()))
ans = 1
while N > K:
    N /=K
    ans += 1
print(ans)
N,K=input().split()
n,k=int(N),int(K)

for i in range(0,1000000):
    if n>k**i:
        continue
    if n<=k**i:
        print(i)
        break
N, K = map(int, input().split())
c = 0
while True:
    if N <= K**c:
        break
    c += 1
print(c)
def main():
    n, k = map(int,input().split()) 
    ret = 1

    while k**ret < n:
        ret += 1

    print(ret)


if __name__ == "__main__":
    main()
n,k=map(int,input().split());print(sum(n>k**i for i in range(1000)))
import math

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

if n == 0:
    print(1)
    exit()

ans = math.log(n, k)

print(math.ceil(ans))
from math import log,ceil
n,k = map(int,input().split())
print(ceil(log(n,k)))
N,K = map(int, input().split())
z = 1
cnt = 0
while z < N:
    z *= K
    cnt += 1
print(cnt)
import math
N,K=map(int,input().split())
if math.log(N,K).is_integer:
    print(int(math.log(N,K)))
else:
    print(int(math.log(N,K))+1)
# スペース区切りの整数入力
N,K = map(int, input().split())

for i in range(10000000000000):
    if N <= K ** i:
        break
print(i)
import math
N, K = map(int, input().split())
print(math.ceil(math.log10(N) / math.log10(K)))
import sys
input = sys.stdin.readline

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

d = 1
while N:
    N //= 2
    d += 1

print(d)
import math

N, K = map(int, input().split())
count = 0
now = 1
while True:
    if N <= now:
        break
    else:
        count += 1
        now *= K
        
print(count)
n,k=map(int,input().split())
i=0
while (n>1):
    n/=k
    i+=1
    print(n)
print(i)
N,K=map(int, input().split())
n=0
while K**(n+1)<N:
  n+=1
  
print(n+1)
N,K=map(int, input().split()) 
for i in range(10):
    if K**i<=N<=K**(i+1):
        print(i+1)
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if K**i < N:
        i += 1
    else :
        ans = i
        break
print(ans)
n, r = map(int, input().split())
for i in range(1, 100000000000):
  if r ** (i - 1) <= n <= r ** i:
    print(i)
    exit()
import math
n, k = map(int, input().split())
print(-int(-math.log(n, k) // 1))
a = list(map(int, input().split()))

b = a[0]
cnt = 0
while b > a[1]:
    cnt = cnt + 1
    b = b / a[1]

if b != 0:
    cnt = cnt + 1

print(cnt)
N,K= map(int, input().split())
A = 0
cnt = -1
if N == 0:
    print(1)
else:
    while N >= A:
        cnt += 1
        A = K**(cnt+1)-1
    print(cnt+1)
n,k=list(map(int,input().split()))
import sys
ans=1
import copy
num=copy.deepcopy(k)

while(1):
  if num>=n:
    print(ans)
    sys.exit()
  num=num*k
  ans=ans+1
n,k = map(int,input().split())
a = 0
while k**a < n:
    a += 1
print(a)
a,b=map(int,input().split())
i=0
while a < 1:
  a = a / b
  i=i+1

print(i)
N, K = map(int, input().split())
i = 1
while K**i < N:
	i = i +1
print(i)
n, k = map(int, input().split(" "))

keta = 1
sum = 0
while True:
    sum += k**(keta-1)*(k-1)
    if sum > n:
        print(keta)
        break
    keta += 1
N,K=map(int,input().split())
S=1
while N>=K:
  K=K*K
  S=S+1
print(S)
n, k = map(int, input().split())

for i in range(31):
    if n // (k**(31-i)) > 0:
        print(31-i+1)
        break
import math
n,k = map(int,input().split())
if n == 1:
  ans = 1
else:
  ans = math.ceil(math.log(k,n))
print(ans)
import math

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

ans = math.ceil(math.log(n+1)/math.log(k))

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

digit = 1
while n > pow(k,digit):
  digit += 1

print(digit)
n,k=map(int,input().split())
x=1
y=0
while x<n:
  x*=k
  y+=1
x/=k
y-=1
m=n%x
if m==0:
  print(y)
else:
  print(y+1)
n,k = map(int,input().split())
for i in range(10**10):
    if k**i >= n :
        ans = i
        break
print(ans)
n,k=map(int,input().split())
if n<k:
  print(1)
  exit()
for i in range (100):
  if k**i < n <k**(i+1):
    print(i+1)
n, k = map(int, input().split())
a = True
cnt = 1
while(a):
    n = n//k
    cnt += 1
    if k > n:
        a = False
print(cnt)
N,K=map(int,input().split())

res=K
ans=1
for i in range(1,N):
    if res>=N:
        print(ans)
        exit()
    res*=K
    ans+=1
N,K=map(int,input().split())
i=0
while N>K**i:
  i=i+1
else:
  print(i+1)
import math
#n,r=list(map(int,input().split()))
n=10**9
r=2
for i in range(40,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    n, k = map(int,input().split())
    x = 1
    y = 0
    while x < n:
        x *= k
        y += 1
    print(y)


if __name__ == '__main__':
    solve()
n,k = map(int,input().split())
count = 1
while n > 0:
  n //= k 
  count += 1
print(count)
N,K = list(map(int,input().split()))
if N == 0:
    print(1)
i =0
while N > 0:
    N -=K
    i += 1
print(i)
import math

n, k = map(int,input().split())
print(math.ceil(math.log(n, k)))
n, k = map(int, input().split())
i = 1
for i in range(1, 10**9+7):
    if n <= k**i:
        break
print(i)
N,K=map(int,input().split())
i=0
while N>K**i:
    i+=1
print(i)
N, K = map(int, input().split())
a = N
i = 0
while a > 0:
    a = N - K ** i
    i += 1
print(i-1)
N, K = tuple(map(int, input().split()))
i = 0
while(N > K ** i):
    i += 1
print(i)
N,K=map(int,input().split())
c=0
while (N//K)>0:
  c = c + 1
  N = N//K
print(c)
n,k = map(int,input().split())
if n == 1:
  print(1)
else:
  for i in range(100000):
    if k**(i-1) < n <= k**i:
      print(i)
      break
# -*- coding: utf-8 -*-

n, k = map(int, input().split())
result = 0

for i in range(35, 0, -1):
    if n >= k**i:
        result = i+1
        break
print(result)
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
x2 = 0
x10, n = input().split()
print(int(x10), int(n))
x10 = int(x10)
n = int(n)
x2 = Base_10_to_n(x10, n)
print( len(x2) )
N,K = map(int,input().split())

for i in range(10000000001) :
    p = pow(K,i)
    if (N <= p) :
        print(i)
        break
n, k = map(int, input().split())
 
tmp = 1
for i in range(100):
    tmp = k * tmp

    if n < tmp:
        print(i)
        exit()
n, k = map(int, input().split())
cnt = 1
while True:
  if n <= k**cnt + 1:
    cnt += 1
  else:
    break
print(cnt)
N, K = map(int, input().split())


def hoge(n, k):
    for i in range(n + 1):
        tmp = k ** i
        if tmp == n:
            return len(str(n))
        elif tmp > n:
            return i


print(hoge(N, K))
n,k = map(int,input().split())
ans = 0
m = 1
while m > n:
  m*k
  ans += 1
print(ans)
import math

n, k = map(int,input().split())
x = math.ceil(math.log(n, k))
print(x)
N, R = map(int, input().split())
if N >= 10:
    ans = R
else:
    ans = R + 100 * (10 - N)
    
print(ans)
n,k=map(int,input().split())
a=n
i=1
while True:
    a=a//k
    if a<k:
        break
    i+=1
print(i+1)
# -*- coding: utf-8 -*-

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

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

for i in range(1000000):
  if pow(k, i) >= n:
    print(i)
    break
n, k = (int(z) for z in input().split())
ans = 0
while n:
  n /= k
  ans += 1
print(ans)
n,k = map(int,input().split())

c=1

for _ in range(0,10**9):
  n=n/k
  if n>=k:
    c+=1
  else:
    break
print(c+1)
n,k = map(int,input().split())

e = 0
for i in range (1000):
    if (n / (k ** (i+1))) > 1:
        e = e + 1
    else:
        e = e

f = e + 1

print (f)
import math

N, K = tuple(int(n) for n in input().split())

if N < K:
    digit = 1
elif N % K == 0:
    digit = math.ceil(math.log(N)/math.log(K)) + 1
else:
    digit = math.ceil(math.log(N)/math.log(K))

print(int(digit))
n,k = map(int, input().split())
count = 0
while n > 0:
    n = n / k
    count += 1 
print(count+1)
N,K=input().split()
C=0
while(int(N)>=int(K)):
  N=int(N)-int(K)**C
  C=C+1
print(C)
n, k = map(int, input(). split())
count = 1
while n > k:
    n /= k
    count += 1
print(count)
from math import log, ceil
print(ceil(log(*map(int, input().split()))))
N, K = [int(_) for _ in input().split()]
for a in range(1, N):
    N = int(N / K)
    if N <= 0:
        print(a)
        break
import math
n,k = map(int, input().split())

N = int(math.floor(math.log(n)/math.log(k)))+1
m = n
L = []
for i in range(N+1):
  L.append(m//(2**(N-i)))
  m = m%(2**(N-i))
  
if L[0] == 0:
  L.pop(0)

ANS = [str(L[i]) for i in range(len(L))]
print("".join(ANS))
N, K = tuple(map(int, input().split()))


i = 1
while (K ** i) < N:
    i += 1
print(i)
n, k = map(int,input().split())

sum = 0
cnt = 0

while True:
    sum += int(k**cnt)
    if n >= sum:
        cnt += 1
    else:
        cnt += 1
        break

print(cnt)
n,k=map(int,input().split());print(sum(n>k**i for i in range(1,100))+1)
import math
n, k = list(map(int, input().split()))
print(math.ceil(math.log(n, k)))
import numpy as np
import math

N, K = map(float, raw_input().split())

log_K = np.log(N)/np.log(K)

print int(math.ceil(log_K))
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/B-Digits.py
#
# 1<= n <= 10**9
# 2<= k <= 10
#

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

digits = int(1)

for digit in range(1, 30):  # 2**29 < 10**9 < 2**<30 なので最高でも30桁
    if k**digit < n:
        digits = digits + 1
    else:
        break

print(digits)
from math import ceil, log

n, k = map(int, input().split())
print(ceil(log(n, k)))
N, K = map(int, input().split())
ans = 0
while K ** ans < N:
  ans += 1
print(ans)
n, k = map(int, input().split())
count = 0
while True:
    n = n / k

    if n < k:
        break
    else:
        count += 1
        continue
print(count + 2)
a = list(map(int, input().split()))
x = 1
counter = 1
while x<a[0]:
  counter += 1
  x = x*a[1]
print (counter)
n, k = map(int,input().split())
know = 1
for i in range(n):
    if n//know == 0:
        print(i)
        break
    else:
        know *= k
n, k = map(int, input().split())
counter = 1
while n <= 1:
    n = int(n / k)
    counter += 1
print(counter)
n, k = map(int, input().split())
e=1
while pow(k, e) < n:
  e+=1
print(e)
N, K = map(int, input().split())
count = 0
while N > K**count:
    count += 1
print(count)
N,K = map(int,input().split())
ans = 0
while N > K**ans:
    ans += 1

print(ans)
import math

NK = input().split()
N = int(NK[0])
K = int(NK[1])

if N == 0:
  result = 1
else:
  result = math.ceil(math.log(N, K))

print(result)
from math import *

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

print(ceil(log(n, k)))
import math

def main():
  N, K = map(int, input().split())
  i = 1
  tmp = 1
  
  while i > -1:
    if N > K ** i:
      tmp += 1
    else:
      print(tmp)
      return
    
    i += 1
  
  
main()
import math
n,k = map(int, input().split())

print(math.ceil(math.log(n,k)))
n,k = map(int,input().split())
i = 0
while (n-k**i>0):
    i += 1
print(i)
import sys
input = lambda: sys.stdin.readline().rstrip() 
import math

def resolve():
    N, K = map(int, input().split())
    print(math.ceil(math.log(N, K)))

if __name__ == '__main__':
    resolve()
n,k=map(int,input().split())
a=0
while n>k**a:
    a=a+1

print(a)
# input
N, K = map(int, input().split())

i = 2
while N > K ** i:
    if N > K ** i:
        i += 1

print(i)
import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)


def main():
    N,K = map(int,input().split())
    print(math.ceil(math.log(N+1,K)))




if __name__ == "__main__":
  main()
i = list(map(int, input().split()))
N = i[0]
K = i[1]

import math
from decimal import *

D = math.log(N, K)

E = Decimal(D).quantize(Decimal('0'), rounding=ROUND_UP)
print(E)
import math
def main():
    N, K = map(int, input().split())
    if K ==1:
        print(N+1)
    elif N % K == 0:
        print(math.ceil(math.log(N,K))+1)
    else:
        print(math.ceil(math.log(N,K)))


if __name__ == '__main__':
    main()
N, K = map(int, input().split())
if K == 10:
  print(len(str(N)))
else:
  res = 1
  KK = K
  while KK < N:
    res += 1
    KK *= K
  print(res)
a = list(map(int, input().split()))

b = a[0]
cnt = 1
while b > a[1]:
    cnt = cnt + 1
    b = b / a[1]

print(cnt)
import math
N, K = map(int, input().split())

a = N
i = 1
while a > K:
    a = a/K
    i += 1
print(i)
N, K = map(int, input().split())
cout = 1
for i in range(N):
    N = N//K
    cout += 1
    if N<K:
        break
print(cout)
n, k = map(int, input().split())

digit = 0
while n > pow(k,digit):
  digit += 1
print(digit)
def main():
    N, K = [int(_) for _ in input().split()]
    i = 0
    while True:
        N_quotient = N // K
        N = N_quotient
        if N_quotient != 0:
            i += 1
        else:
            break
    print(i)
main()
N,K=map(int, input().split()) 
for i in range(7500):
    if K**i<=N<=K**(i+1):
        print(i+1)
def resolve():
    import math
    n,k = map(int, input().split())
    log = math.log(n,k)
    print(math.ceil(log))
resolve()
N,K=map(int,input().split())
cnt=1

while N > K**cnt:
  cnt += 1
  
print(cnt)
n,k=map(int,input().split())
ans=0
while k**ans<n:
    ans+=1
print(ans)
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    n, k = map(int,input().split())
    x = 1
    y = 0 if n != 1 else 1
    while x <= n:
        x *= k
        y += 1
    print(y)


if __name__ == '__main__':
    solve()
n, k = map(int, input().split())
def clas(n, k):
    li = []
    while True:
        c = n // k
        li.append(c % k)
        if c < k:
            li.append(c)
            break
        n = c
    return li

print(len(clas(n, k)))
N,K = map(int,input().split())
ans = 1
while True:
    if K**ans >= N:
        print(ans)
        exit()
    else:ans += 1
n, k = list(map(int, input().split()))

for i in range(1000):
  if pow(k, i) >= n:
    print(i)
    break
N,K = map(int,input().split())
cnt = 1
for i in range(N):
    if N>K:
        N /= K
        cnt += 1
    else:
        break
print(cnt)
n, k = map(int, input().split())

def calc(n, k):
  i = 1
  tmp = n
  while (tmp > k):
    print(tmp, i)
    tmp = tmp - k**i
    i +=1
  return i + 1

print(str(calc(n,k)))
n, k = list(map(int, input().split()))
if k == 10:
    ans = len(str(n))
else:
    l = []
    while True:
        l.append(n % k)
        n = n // k
        if n// k == 0:
            l.append(n % k)
            break
    ans = len(l)
print(ans)
n,k = map(int, input().split())
# n,k = map(int, "282475249 7".split())

isFlg = False
i=1
while True:
    tmp = k **i

    if n <= tmp:
        isFlg = True

    i+=1

    if isFlg:
        break

print(i)
a = list(map(int, input().split()))
x = 1
counter = 0
if a[0] == 1:
    print(1)
else:
    while x<a[0]:
        counter += 1
        x = x*a[1]
print (counter)
N, K = map(int, input().split())

for i in range(N+1):
    if K ** i >= N:
        print(i)
        break
N, K = map(int, input().split())

ans = 0
while N > 1:
  ans += 1
  N /= K
print(ans)
N,K=map(int,input().split())

a=0
b=0
c=0
for _ in range(36): #log2 10^9=9log2 10<36
    a=N//K
    b=N%K
    N=a
    c+=1
    if a<K:
        c+=1
        print(c)
        exit()
import math

def resolve():
    N,K=map(int,input().split())
    A=math.log(N,K)
    print(math.ceil(A))




if __name__ == "__main__":
    resolve()
N, K = map(int, input().split())

i = 1
while K**i < N:
    i += 1

print(i)
import math

[N, K] = map(int, raw_input().split())

d = int(math.ceil(math.log(N+1)/math.log(K)))

print d
import math

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

print(math.ceil(math.log(N,K)))
N, K = map(int, input().split())

i = 1
while(N > K):
	N = N / K
	i += 1

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

for i in range(31):
    if k**i-1 > n:
        print(i)
        exit()
n, k = map(int, input().split())

keta = 0
for i in range(10**9):
    ki = k**i
    if ki >= n:
        print(keta)
        break
    else:
        keta += 1
N,K=map(int,input().split())

ans=0

for i in range(N):
    if K**i>N:
        ans=i
        break
print(ans)