peterverebics/CodeNet_Python_118 huggingface dataset:
# coding: utf-8
# Your code here!
N, K = map(int, input().split())

########関数部分##############
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)
############################
 
 
#####関数をつかってみる．#####
######今回は二進数に変換######
x10 = N
x2 = Base_10_to_n(x10, K)
print( len(str(x2)) )#"100011"が表示される．
n,k = map(int,input().split())

ans = 1
i = k
s = 1

while(n%i != n):
    s += 1
    i  = k ** s
    ans += 1

print(ans)
n,k = map(int,input().split())
ans=[]
while n:
    if n%k != 0:
        ans.append(n%k)
        n=n//k
    else:
        ans.append(0)
        n = n//k

print(len(ans))
n , k = map(int,input().split())
count = 1
origk = k
while(True):
    if n <= k:
        print(count)
        break
    
    k *= origk
    count+=1
from math import log, ceil


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


if __name__ == '__main__':
    main()
N,K=(int(x) for x in input().split())
k=0
a=K
while a<=N:
    k=+1
    a=K*10**k
print(k)
import math
def main():
    N, K = map(int, input().split())
    print(math.ceil(math.log(N+1,K)))


if __name__ == '__main__':
    main()
import math
N,K = map(int,input().split())
print(math.ceil((math.log(N,K))))
# -*- coding: utf-8 -*-
import math

n, k = map(int, input().split())
result = math.log(n, k)
print(math.ceil(result))
n,k = map(int,input().split())
for i in range(1,10 ** 9):
    if n - k ** i < k:
        print(i)
        break
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)
import math
x, y = [int(x) for x in input("").split()]
a = math.log(x,y)
b=x%y
if(b==0):
    print (math.ceil(a)+1) 
else:
    print (math.ceil(a))
import sys

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

if K == 10:
    print(len(str(N)))
    sys.exit()

p = 0
while True:
    num = K ** p
    if N <= num:
        break
    p += 1

print(p)
N, K = map(int, input().split())
q = N/K
num = 0
while q >0:
  q = q / (K**num)
  num = num + 1
print(num)
n,k = map(int,input().split())
ans = 0
for i in range(10**9):
    if n >=2:
        n = n//k
        ans +=1
    else:
        break
print(ans+1)
n, k = map(int,input().split())

sum = 0
cnt = 0

while True:
    sum += int(k**cnt)
    if sum <= n:
        cnt += 1
    else:
        break
print(cnt)
n, k = map(int, input().split())
i = 1
while k ** i < n:
    i += 1
print(i+1)
#!/usr/bin/env python3

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

main()
n, k = map(int, input().split())
print(n // k + 1)
N,K = map(int,input().split())
n=1
while N>K:
	N=N/K
	n += 1
	
if N==1:
	print(1)
else:
	
	print(n)
n,k=map(int,input().split())
ans=0
for i in range(n):
    if n>=1:
        n=n/k
        ans+=1
    else:
        print(ans)
        break
N, K = map(int, input().split())
flag = True
ans = []
while flag:
    M = N % K
    N = N // K
    ans.append(M)
    if N // K == 0:
        ans.append(N)
        flag = False
print(len(ans))
#!/usr/bin/env python3
import math

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

print(ans+1)
N,K = map(int,input().split())
Count=0
while N > 0:
  N = int(N/K)
  print(N)
  Count=Count+1
print(Count)
N, K = map(int, input().split())
count = 1
while True:
    N = N // K
    count += 1
    if N <= K:
        break
print(count)
n,k=map(int,input().split())
n=0
while n>=k**n:
    n+=1
print(n)
n,k=map(int,input().split())
curr=1
ans=1
while(curr<k):
  curr*=k
  ans+=1
print(ans)
N, K=map(int, input().split())
i=1
while K**i<N:
  i+=1
print(i)
N, K = map(int, input().split())

num_of_digits = 1

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

print(num_of_digits)
n, k = map(int,input().split())
count = 1
origk = k
while(True):
    if n <= k:
        print(count)
        break
    k *= origk
    count+=1
N,K=map(int, input().split()) 
for i in range(9999):
    if K**i<=N<=K**(i+1):
        print(i+1)
import math
n, k = list(map(int, input().split(" ")))

a = n
c = 0
while True:
    a = a // k
    c += 1
    if a < k:
        print(c + 1)
        exit()
n , k = map(int,input().split())
ans = []
ans.append(n%k)
n = n//k
while n >= k:
    ans.append(n%k)
    n = n//k
ans.append(n)

print(len(ans))
# coding: utf-8
n, k = map(int, input().split())
ans = 1
while n > k:
    n = n // k
    ans = ans + 1
print(ans)
N,K = map(int,input().split())
for i in range(1,31):
    if K**i <= N < K**(i+1):
        print(i+1)
        break
from math import ceil
from math import log
n,k=map(int,input().split())
print(ceil(log(n)/log(k)))
i= list(map(int, input().split()))
j=1
while i[0]>i[1]**j:
  j+=1
print(j)
INT_MAX=10**18+7
x=10**9+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
GETA=123
###############################################################################
import math as M
n,k=INPUT()
print(M.ceil(M.log(n,k)))
import numpy as np
N,K = map(int,input().split())
a = True
b=0
if N<K:
    print(1)
elif K==10:
    while(a):
        if N//K==0:
            a=False
        else:
            N=N//K+N%K
            b+=1
    print(b+1)
else:
    while(a):
        if N//K==0:
            a=False
        else:
            N=N//K+N%K
            b+=1
    print(b)
N,K=map(int,input().split())
a = 1
while K <= N:
  N = N // K
  a =a+1
  print(a)
 
print(a)
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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


if __name__ == '__main__':
    main()
import math
x, y = [int(x) for x in input("").split()]
a = math.log(x,y)
b=x%y
c=x/y
if(c==0):
    print ("1")
elif(b==0):
    print (math.ceil(a)+1) 
else:
    print (math.ceil(a))
N, K = map(int, input().split())

i = 1
while True:
    if N > K ** i:
        i += 1
    else:
        i -= 1
        break
print(i + 1)
N,K=map(int,input().split())
x=0
while True:
	if N<=K**x:
		print(x)
		break
	x+=1
n,k =list(map(int,input().split()))
A=1

while True:
    n =n//k
    A+=1
    if n//k<1:
        break
print(A)
import  math as m
N,K=map(int,input().split())
r=m.log(N,K)
if r>int(r):
    print(int(r+1))
else:
    print(int(r))
n,k = map(int,input().split())
if(n%k==0 or n//k ==0):
  a = 0
else:
  a = 1
for i in range(100000000000):
  n =  n//k
  a +=1
  if(n==1 or n==0):
    break
print(a)
N,K = map(int,input().split())
n = N
x = 0
while n > K:
    n = N // K
    x += 1
print(x)
from sys import stdin
import math

n, k = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 1
if n <= k:
    print(cnt)
    exit

kk = k
while n >= kk:
    kk = kk * k
    cnt += 1


print(cnt)
import math
x,y = map(int ,input().split())
m = math.ceil(math.log(x, y))
print(m)
a,b=map(int,input().split())
cnt=0
while a>0:
  a//=b
  cnt+=1
n,k=map(int,input().split())
l=[]
if k<=9 :
  while True:
    a=n%k
    n//=k
    if n>=k:
      l.append(a)
    if n<k :
      l.append(n)
      break
  print(len(l))
else:
  print(len(str(n)))
N, K = map(int, input().split())
T = 0

while T != 0:
  N = N // K
  T += 1
  
print(T)
import numpy as np
import math

n,k = str(input()).split()
ans = np.log(int(n))/np.log(int(k))
print(math.ceil(ans))
def main(n, k):
    t = 0
    i = 0

    while n > t:
        t = k ** i
        i += 1

    print(max(i - 1, 0))


if __name__ == "__main__":
    n, k = map(int, input().split())

    main(n, k)
N, K = map(int,input().split())
count = 0
while N > K :
  N = int(N / K)
  count += 1
print(count + 2)
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 == 0:
    N = N // K
    ans += 1
print(ans)
import math
n, k = map(int, input().split())
print(math.ceil(math.log(n, k)))
num, k = map(int, input().split())

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

dig = 0
while True:
  if n > pow(k,dig):
    dig += 1
  else:
    break
print(dig)
import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N, K = map(int, readline().split())
  ans = math.log(1,2)
  print(math.ceil(ans))
  
  
  
if __name__ == '__main__':
  main()
n, k = map(int, input().split())
counter = 1
while n >= k:
    n = int(n / k)
    counter += 1
    print(n)
print(counter)
n,k = map(int,input().split())
ans = 1
while n>k:
    n = 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>1:
        print(i)
        break
    if n==k**i-1:
        print(i-1)
        break
import math
N, K = map(int, input().split())
print(math.ceil(math.log(N, K)))
import math
n,k = map(int, input().split())

L = []
while True:
  N = int(math.floor(math.log(n)/math.log(k)))
  L.append(N)
  n = n - k**N
  if n <= 2:
    print(len(L)+1)
    exit()
n, k = map(int, input().split())
i = 1
while k ** i < n:
    i += 1
print(i)
N, K = map(int, input().split())
i = 0
while K**i < N: i += 1
print(i)
N, K = map(int, input().split())

for i in range(1, N**N):
  if N < K**i:
    print(i)
    break
a = list(map(int, input().split()))
b = a[0]
c = 0
while b > 0:
  b = b / a[1]
  c += 1
print(c)
import math

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

if math.log(n,k) == int(math.log(n,k)):
  res=math.log(n,k) + 1
else:
  res=int(math.log(n,k)) + 1

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

while N>a:
    ans+=1
    a=a*K
print(ans)
import math
N, K = input().split(" ")
print(math.ceil(math.log(int(N),int(K))))
def resolve():
    n, k = map(int, input().split())
    div_val = k
    i = 1
    while True:
        if n / div_val <= 1:
            print(i)
            return
        else:
            div_val *= k
            i += 1

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

for i in range(1000000):
    if k**i >= n:
        print(i)
        break
from sys import stdin
import math

n, k = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 1
if n < k:
    print(cnt)
    exit

kk = k
for i in range(100):
    kk = kk * k
    cnt += 1
    if n < kk:
        break

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

while N > 0:
  N /= K
  ans += 1
  
print(ans)
N,K=map(int,input().split())
ans=0
temp=1
while temp<N:
    temp*=K
    ans+=1
print(ans)
a,b=map(int,input().split())
ans=1
while 1:
  if a==0:
    break
  a//=b
  ans+=1
print(ans)
# coding: utf-8
import math
n, k = map(int, input().split())
print(math.ceil(math.log(n, k)))
import math
n,k=map(int,input().split())
print(math.ceil(math.log(n,k)))
N,K = map(int,input().split())
cnt = 0
while(N>1):
    N /= K
    cnt += 1
print(cnt)
n,k=map(int,input().split())
import math
print(math.ceil(math.log(n,k)))
N,K = map(int, input().split())
i = 0
while K**i < N:
    i+=1
else:
    print(i)
n,k = map(int,input().split())
l = []
for i in range(1,n):
  if n > 0:
    n = n // k
    l.append(n)
  else:
    break
print(len(l))
s = input().split()

N = int(s[0])
K = int(s[1])

i=1
while N > K **(i-1):
  if N < K**i:
    print(i)
  elif N == K**i:
    print(i+1)
  i += 1
n , k = map(int , input().split())
ans = 0
m = 1
while m < n:
    m = m * k
    ans += 1
print(ans)
N, K = map(int,input().split())

ans = 0
for i in range(10**9):
    if K**i < N:
        i = i + 1
    else:
        ans = i
        break
        
print(ans)
N, K = tuple(map(int, input().split()))


x = K
cnt = 1
while x < N:
    x *= K
    cnt += 1
print(cnt)
N, K = [int(x) for x in input().split(" ")]

i=1
x=K

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

print(i)
n,k = map(int,input().split())
d = k
ans = 1
while True:
    if k >= n:
        break
    ans += 1
    k *= d
print(ans)
n,k = map(int, input().split())

digits = 0
while n:
  digits += 1
  n//=10
  
print(digits)
n,k = map(int, input().split())
 
for i in range(1,10):
  if n <= k ** i - 1:
    print(i)
    break
n, k = map(int, input().split())
i = 1
r = 1
while True:
    i+=1
    if n - k**r > 0:
        n -= k ** r
    else:
        if k > n:
            i = 1
        break
    r+=1
print(i)
x,y = map(int,input().split())

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

while(K**t < N):
	#print(K**t)
	t+=1

print(t)
import math

def main():
    strA = input()
    listA = strA.split(" ")

    N = int(listA[0])
    K = int(listA[1])

    x = N
    y = 0
    while(1):
        x = x/K

        y = y + 1
        if(x < K):
            if K - x > 0:
                y = y + 1
            break

    print(y)

if __name__ == '__main__':
    main()
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if N < K:
        ans = 1
        break
    elif N == K:
        ans = 2
        break
    elif K**i < N:
        i += 1
    else :
        ans = i
        break 
print(ans)
import math

N, R = map(int, input().split())
X = math.log(N + 1, R)
Y = math.ceil(X)

print(Y)
a, b = input().split()
c = int(a)
d = int(b)

flag = True
ans = 1

while flag:
  if d ** ans >= c:
    flag = False
    break
  else:
    ans += 1
    
print(str(ans))
n,k=map(int,input().split())
t=0
while n>k**t:
	t+=1
print(t)
strings = input().split(' ')
N = int(strings[0])
K = int(strings[1])
 
ans = 1
max = 1

while max < N:
  max = max * K
  ans  =ans + 1
  
print(ans)
n,k=map(int,input().split())
a=1
c=0
while a<n:
    a*=k
    c+=1
print(c)
n,k=map(int,input().split())
i=1
while n>0:
  n//=k
  i+=1
print(i)
N, K = [int(_) for _ in input().split()]
for a in range(0, 10**9):
    N = int(N / K)
    if N <= 0:
        print(a)
        break
import math
 
i = input().split()
N = int(i[0])
K = int(i[1])
result = 0
 
result = math.log(N, K)
if int(result) != result:
  result = 1 + int(result)
else:
  result = int(result)
 
print(result)
n,k=map(int,input().split())
tmp=k
cnt=1
while n>tmp:
    tmp=tmp*k
    cnt+=1
print(cnt)
import math
N, K = [int(i) for i in input().split()]

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

ans = 1
for i in range(100):
  if N > K**(i):
    ans = i+1
print(ans)
n,k = map(int,input().split())
for i in range(2,30):
    if n >= k**(i-1) and n < k**i:
        print(i)
N, K = map(int, input().split())
ans = 0

while N > K:
  N /= K
  ans += 1
  
print(ans)
a = list(map(int, input().split()))
b = a[0]
c = 0
while b > 1:
  b = b / a[1]
  c += 1
print(c)
N,K=map(int,input().split())
n=1
while True:
  if N<=(K**n):
    break
  n+=1
print(n)
n, k = map(int, input().split(" "))

keta = 1
sum = 0
while True:
    max = k**keta-1
    if max > n:
        print(keta)
        break
    keta += 1
import math
N, K = list(map(int, input().split()))
print(math.floor(math.log(N, K)-1e-3)+1)
n, k = map(int,input().split())
know = 1
for i in range(n):
    if (n+0.5)//know == 0:
        print(i)
        break
    else:
        know *= k
import math
n, k = list(map(int, input().split(" ")))

a = n
c = 0
while True:
    a = math.floor(a / k)
    c += 1
    print(a)
    if a <= k - 1:
        print(c + 1)
        exit()
import math
n,k = map(int,input().split())
ans = math.ceil(math.log(n,k))
print(ans)
N, K = map(int, input().split())

num = 0
beki = 0

while num < N:
    num = num + K**beki
    beki += 1
else:
    print(beki)
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    N, K = map(int, input().split())

    keta = 0
    while True:
        if N >= K ** keta:
            keta += 1
            N -= K ** keta
        else:
            break

    print(keta + 1)


if __name__ == '__main__':
    solve()
import numpy as np
N, K = map(int, input().split())

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


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

print(math.ceil(math.log(N, K)))
n, k = list(map(int, input().split()))
ans = 0
while True:
    l = []
    l.append(n % k)
    n = n // k
    if n // k == 0:
        l.append(n % k)
        break
ans = len(l)
print(ans)
import math
N,K = map(int, input().split()) 
print(math.ceil(math.log(N, K)))
n, k = map(int, input().split())

a = 1
while n > k ** a:
    a += 1
print(a)
N,K  = map(int,input().split())
lis = [K**i for i in range(70)]

for i in range(len(lis)):
    if N -lis[i]<= 0 and i ==0:
        print(1)
        break
    if N -lis[i] <=0:
        print(i)
        break
n,k=map(int,input().split())
ans=0
while(n>1):
  n//=k; ans+=1
print(ans)
import math

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

result = math.log(N, K)
if int(result) != result:
  result = 1 + int(result)

print(result)
[N,K] = list(map(int,input().split()))
if N<K:
    print(1)
else:
    i=N
    j=0
    while i>K:
        i = i/K
        j=j+1
    print(j+1)
x,y = map(int,input().split())

for i in range(10000):
    k = y**i
    if k >= x:
        break
print(i)
n,k = map(int,input().split())

y = k
cnt = 1
while n > k:
    k *= y
    cnt += 1
print(cnt)
#!/usr/bin/env python

i = 1
nums = input()
nums = nums.split(' ')
x, y = (int(val) for val in nums)

while x > y:
    x = x / y
    i += 1

print(i)
N,K = map(int,input().split())
count = 0
while True:
    if N>(K**count):
        count += 1
    else:
        break
if N == 1:
    count = 1
if len(str(N))!=len(str(N-1)):
    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())

for i in range(10000000):
    if k**i-1>n:
        print(i)
        break
N, K = map(int, input().split())
i = 0
while N > K ** i:
    i += 1
print(i)
N, K = list(map(int, input().split()))
x = 0
while N >= (K**x):
    if N <= (K**x):
        break
    else:
        x += 1
print(x)
N, K = map(int, input().split())
ans = 0

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

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

maxDigits = 0
for i in range(10):
  if N/K**i >= 1:
    maxDigits = i+1

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

print(i)
a = list(map(int, input().split()))
x = 1
counter = 0
if a[0] < a [1]:
    counter = a[0]
else:
    while x<a[0]:
        counter += 1
        x = x*a[1]
print (counter)
import math
N, K = map(int, input().split())
t = math.log(N, K)
print(math.ceil(t))
N,K = map(int,input().split())
count = 0
while True:
    N = N / K
    count += 1
    if N < K:
        count = count + 1
        break
print(count)
import math

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

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

ans = 0

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

print(ans)
import math

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

print(math.ceil(ans))
nums=[int(i) for i in input().split()]
k=nums[0]
cnt=1
while k>1:
    k=int(k/nums[1])
    cnt+=1

if nums[0]%nums[1]==0:
    print(cnt-1)
else:
    print(cnt)
import math

words = lambda t : list(map(t, input().split()))
n,k = words(int)

print(math.ceil(math.log(n,k)))
n,k=map(int,input().split())
i=1
u=0
while n>u:
    u=k**i

    i+=1
print(i-1)
n, k = map(int, input().split())
ans = 0

for i in range(99999999):
    t = k ** i
    if n > t:
        ans += 1
    else:
        break

print(ans + 0)
X, n = map(int, input().split())

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)

x10 = X 
x2 = Base_10_to_n(x10, 2)
print(len(x2))
N, K = map(int, input().split())

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

print(ans)
n,k=map(int,input().split())
cnt=0
while n>0:
    n=n/k
    cnt+=1
print(cnt)
n,k = map(int,input().split())
tempk = k
ans = 1
while 1:
    if tempk<n:
        ans+=1
        tempk*=k
        
    else:
        break



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

d = 1
C = K
while N > C:
    d += 1
    C *= K
print(d)
def Base_10_to_K(N, K):
    if (int(N/K)):
        return Base_10_to_K(int(N/K), K)+str(N%K)
    return str(N%K)
import math
n, k = map(int, input().split())
i = 1
count = 1
while k**i < n:
    count += 1
    i += 1
print(count)
import math
n,r=list(map(int,input().split()))
for i in range(10,-1,-1):
    if r**i<=n:
        ans=i+1
        break
print(ans)
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,k = iim()
ans = 0
while k**ans < n:
    ans += 1

print(ans)
N,K=map(int,input().split())
a=0
while N//K>=K:
  N=N//K
  a=a+1
print(a+2)
import numpy as np

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

print(len(str(n)))
import math

dec, base = list(map(int, input().split(' ')))

print(math.ceil(math.log(dec,base)))
N,K=list(map(int,input().split(' ')))
i=0
while N>K**i:
    i=i+1
print(i)
l=[int(x) for x in input().split()]
N=l[0]
K=l[1]
ans = []

while True:
  ans.append(int(N) % int(K))
  N = int(N) / int(K)
  if N < K:
    ans.append(int(N))
    break
    
print(len(ans))
N,K=map(int,input().split())
i=0
while True:
    if N<=K**i:
        print(i)
        break
    i+=1
n, k = map(int, input().split())

rank = len(str(n))
while n > 0:
  ans = []
  ans.append(n % k)
  n = int(n / k)
  i = rank - len(str(n))
  n = n * 10**i
  k = k * k

print(len(ans))
N, K = map(int, input().split())
for i in range(10**9):
    if N > K** i and N <= K**(i+1):
        print(i+1)
        break
# -*- coding: utf-8 -*-
import math
N,K = map(int, input().split())
print(int(round(math.log(N, K),0)))
# input
N, K = map(int, input().split())

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

ans = ""

while True:
  r = str(N % K)
  ans += r
  N = N // K
  if N < K:
    ans += str(N % K)
    break
  
print(len(ans))
N, K = map(int, input().split())
i = 1
while K**i < N:
  i = i +1
print(i)
import sys


def main():
    input = sys.stdin.buffer.readline
    n, k = map(int, input().split())
    i = 1
    while k ** i < n:
        i += 1
    print(i)


if __name__ == "__main__":
    main()
#!/usr/bin/env python

i = 1
nums = input()
nums = nums.split(' ')
print(nums)
x, y = (int(val) for val in nums)

while x > y:
    x = x / y
    i += 1

print(i)
import math

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

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

print d
N, K = map(int, input().split())
ans = 1
K_ = K
while N > K_:
    K_ *= K
    ans += 1
print(ans)
import math

N, K = map(float, input().split())
tans = math.log(N, K)

ans = math.ceil(int(tans * 10**9)/10**9)
print(ans)
import math


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

ans = math.ceil(math.log(N)/math.log(K))
print(ans)
import  math
N, K = map(int, input().split())
t = 1
x = N
n = 0
while (True):
    n += 1
    x -= t * (K - 1)
    if x < 0:
        break

    t *= K


print(n)
import math
[n, r] = map(int, input().rstrip().split(' '))

print(math.ceil(math.log(n, r)))
import math

N, K = map(float, input().split())
ans = int(math.ceil(math.log(N, K) * 10 **9) / 10 ** 9)
print(ans)
N, K = map(int, input().split())
ans = 0
while N % K == 0:
    N = N // K
    ans += 1
print(ans)
n,k = map(int, input().split())
res = 0
m = n-1
a = 1
while True:
    if n <= k**a:
        ans = a
        break
    a += 1
print(ans)
n, k = map(int, input().split())
count = 0
while True:
    n = n // k
    count += 1
    if n < k:
        count += 1
        break
    else:
        continue
print(count)
N, K = map(int, input().split())

cnt = 1
while N > K:
    N = N / K
    cnt += 1
print(cnt)
from math import log, ceil
n, k = map(int, input().split())
l = log(n, k)
print(ceil(l))
i = list(map(int, input().split()))
N=i[0]
K=i[1]
def abc(N,K,x):
    if N-(K**x)>0:
      abc(N,K,x+1)
    else:
        print(x)
abc(N,K,1)
NK = input().split()

N = int(NK[0])
K = int(NK[1])

ans = 0
while True:
    if N > K**ans:
        ans += 1
    else:
        break
print(ans)