peterverebics/CodeNet_Python_118 huggingface dataset:
n, k = map(int,input().split())
i = 1
while n >= k:
  n = n//k
  i += 1
print(i)
N,R = map(int,input().split())

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

print(len(Base_10_to_n(N, R)))
n, k = map(int, input().split())

ans = 0
t = k**(ans)
while n >= t:
  ans += 1
  t=k**(ans)
if n == 0:
  print(1)
else:
  print(ans)
N,K=map(int,input().split())

ans=1

while True:
  N=N//K
  if N==0:
    break
  ans+=1

print(ans)
def main():
  N,K=map(int,input().split())
  sFlag=True
  s=0
  while(sFlag):
    sk=K**s
    if(N>=sk):
      sans=s
      s=s+1
    else:
      print(sans+1)
      sFlag=False

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

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

out = []
while 1:
  out.append(N%K)
  N = int(N/K)
  if N == 0:
    break
  elif 0 < N <= K-1:
    out.append(K-1)
    break
print(len(out))
#!/usr/bin/env python3
n,k = map(int,input().split())
ans = 1
while True:
    if n >= k**ans: ans += 1
    else: break
print(ans)
n,k=map(int,input().split())
count=1
num=n
while True:
    if num<k:
      print(count)
      exit()
    else:
      num=num/k
      count+=1
n,k = map(int,input().split())
ans = 0
while n != 0:
  n = int(n / k)
  ans += 1
print(ans)
n, r = map(int, input().split())
for i in range(1, 10**100):
  if r ** (i - 1) <= n < r ** i:
    print(i)
    exit()
n, k = map(int, input().split())

i = 1
j = k

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

print(i)
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)

print(len(Base_10_to_n(N, K)))
n,k=(int(x) for x in input().split())
i=0
while(n>=k**i):
  i+=1
print(i)
N, K = map(int,input().split())
ans = 0
while(K ** ans <= N):
    ans += 1
print(ans)
n, k = map(int, input().split())

ans = ''
while n > 0:
    ans = str(n % k) + ans
    n //= k
print(len(ans))
inp = [int(i) for i in input().split()]
N = inp[0]
K = inp[1]
n = N
c = 0
while n>=1:
  n /= K
  c += 1
print(c)
import sys
input = sys.stdin.readline


def main():
    N, K = map(int, input().split())
    answer = 1
    while N >= K:
        N //= K
        answer += 1
    print(answer)


if __name__ == '__main__':
    main()
n,k =map(int,input().split())
digitlist = []

while (n/k != 0):
	tmp = n%k
	digitlist.insert(0,(tmp))
	n = n//k

print(len(digitlist))
inputs = input().split()
n = int(inputs[0])
k = int(inputs[1])
cnt = 1
while n >= k:
  n = n // k
  cnt += 1
print(cnt)
n, k = map(int, input().split())
cnt = 0
while n >= k**cnt:
    cnt += 1
print(cnt)
N,K=map(int,input().split())

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

print(ans)
n,k = map(int,input().split())
for i in range(n):
    n = n // k
    if n == 0:
        print(i + 1)
        exit()
n, k = map(int, input().split())
answer = 0
while True:
    if n // k != 0:
        n = n // k
        answer += 1
    else:
        break
print(answer + 1)
import numpy as np
N, K = map(int, input().split(" "))

i = 1
while K ** i <= N:
    i += 1
else:
    print(i)
N,K = map(int,input().split())
for i in range(100):
    if N<K**i:
        print(i)
        break
n, k = input().split()
n = int(n)
k = int(k)
res = 0
while n >= k:
    n /= k
    res += 1

res += 1
print(int(res))
N,k = map(int,input().split())

a = True
remain = N
dir_list = []

while a:
    if  remain // k > 0:
        dir_list.append(remain)
        remain = remain // k
    else:
        a = False

print(len(dir_list)+1)
from math import log
n, k = map(int, input().split())
print(int(log(n, k))+1)
#!/usr/bin/env python3
n, k = map(int, open(0).read().split())
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
print(len(Base_10_to_n(n, k)))
n, k = map(int, input().split())
ans = 0
while n > 0:
  ans += 1
  n //= k
print(ans)
def main():
    n,k = map(int,input().split())
    bi = ''
    while n != 0:
        bi += str(n % abs(k))
        if k < 0:
            n = -(-n // k)
        else:
            n = n // k
    bilast = bi[::-1]
    print(len(bilast))

if __name__ == '__main__':
    main()
#!/usr/bin/env python3

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

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


print(len(Base_10_to_n(N, K)))
def resolve():
    N, K = list(map(int, input().split()))
    cnt = 1
    while N >= K**cnt:
        cnt += 1
    print(cnt)

if '__main__' == __name__:
    resolve()
n, k = map(int, input().split())
x = n
ans = 1
while x >= k:
  x = x // k
  ans += 1
print(ans)
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)


print(len(base_10_to_n(n, k)))
import sys

n,k = map(int,input().split())
if n == 1:
	print(1)
	sys.exit()
i = 0
num = 1
while True:
	if n < num:
		break
	num *= k
	i += 1

print(i)
n,k=map(int,input().split())
i=0
while k**i<=n:
  i+=1
print(i)
def base10to(n, r):
    ans = 0
    while n > 0:
        n //= r
        ans += 1
    return ans

N,R = map(int,input().split())
print(base10to(N, R))
import math
n,k = map(int, input().split())

if n==1:
  print(1)
  exit()
  
print(int(math.ceil(math.log(n,k))))
N, K = map(int, input().split())
keta = 0

while (N > 0):
    N = N // K
    keta += 1

print(keta)
def resolve():
    n, k = map(int, input().split())
    ans =0
    while True:
        ans +=1
        n = n//k
        if n <=0:
            break
    print(ans)
    
if __name__ == "__main__":
    resolve()
n,k = map(int, input().split())

ans = 0

while n >= k**ans:
    ans += 1

print(ans)
import sys

def main():

    # sys.stdin = open('input156b.txt')

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

    ans = 0
    m = 1
    while n >= m:
        m *= k
        ans += 1

    print(ans)
if __name__ == '__main__':
    main()
def modd(x, y):
    mod(x, y)

n, k = map(int, input().split())
count = 0
while n >= k:
    shou = n//k
    n = shou
    count += 1
print(count+1)
import sys


def input():
    return sys.stdin.readline()[:-1]


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)

print(len(Base_10_to_n(N, K)))
import math

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

list=[]
while N>=K:
    x=N%K
    N=N//K
    list.append(x)

list.append(N)
print(len(list))
n,k=map(int,input().split())
import math
a=math.log(n,k)
b=math.ceil(a)
if a==b:
    print(b+1)
else:
    print(b)
N, K = map(int, input().split())
b=0
while N>0:
  N=N//K
  b+=1
print(b)
n, k = map(int, input().split())
i = 0
while n >= k**i:
  i+=1
print(i)
N,K = map(int,input().split())
for i in range(1,100000000):
    if K ** i > N:
        print(i)
        break
a, b = 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)

print(len(Base_10_to_n(a, b)))
def main():
    n, k = map(int, input().split())
    a = 1
    i = 0
    while n >= a:
        a = k ** i
        i += 1
    print(i-1)





    
if __name__ == "__main__":
    main()
import math

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

x = math.log(n, k)
x = math.floor(x)

print(x+1)
n,k = map(int,input().split())
cnt = 0
while True:
    if n < k and n%k == 0:
        break
    cnt += 1
    n //= k
print(cnt)
def main():
    N, K = map(int, input().split())
    x = Base_10_to_n(N, K)
    print(len(x))


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)


if __name__ == '__main__':
    main()
n,m=map(int,input().split())
from math import log
print(int(log(n)/log(m))+1)
N,K = list(map(int,input().split()))
A = []
A.append(1)

for i in range(N):
    p = K * A[i]
    if p > N:
        print(i+1)
        break
    else:
        A.append(p)
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    (N, K) = map(int, inp.readline().strip().split(' '))

    i = 0
    while True:
        if N == 0:
            break
        i += 1
        N = int(N / K)

    return str(i)


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()
ans=0
n,k=map(int,input().split())
while True:
    n=n//k
    ans+=1
    if n==0:
        break
print(ans)
N, K = map(int, input().split())
ans = 0
while N//pow(K, ans) >=1:
  ans += 1
print(ans)
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)
ans = len(Base_10_to_n(n, k))
print(ans)
n,k=map(int,input().split())

wrk=1
for i in range(1,10**9):
    wrk*=k
    if n < wrk:
        print(i)
        exit()
import math
N,K = map(int,input().split())
print(1) if N == 1 else print(math.ceil((math.log(N,K))))
n, k = map(int, input().split())
for i in range(30, -1, -1):
    if n >= k**i:
        print(i + 1)
        break
def main():
  n,k = list(map(int,input().split()))
  ans=0
  while n>0:
    ans+=1
    n=int(n/k)
  print(ans)
main()
N,K=map(int,input().split())
x=0
while K**x<=N:
    x=x+1
print(x)
# Python3 program to Find Number of digits 
# in base b. 

import math 

# function to print number of 
# digits 
def findNumberOfDigits(n, base): 
	
	# Calculating log using base 
	# changing property and then 
	# taking it floor and then 
	# adding 1. 
	dig = (math.floor(math.log(n) /math.log(base)) + 1)
	return dig

# Driver method 

# taking inputs 
n,k=map(int,input().split())

# calling the method 
print(findNumberOfDigits(n, k))

# This code is contributed by 
# Manish Shaw (manishshaw1)
def calculate_num(m, n):
  integer = m
  base = n
  result = ''
  digit = 0
  while integer > 0:
    result += str(integer%base)
    integer = integer//base
    digit = len(result)
  return digit

def main():
  num = input()
  num_list = num.split()
  number = int(num_list[0])
  base = int(num_list[1])
  result = calculate_num(number, base)
  print(result)
main()
N, K = map(int,input().split())
total = 1
while N >= K:
  N = N//K
  total += 1
print(total)
N,K=map(int,input().split())
cnt=0
while True:
  if N<(K**cnt):
    break
  else:
    cnt+=1
print(cnt)
n, k = list(map(int, input().split()))

def ntok(X, N):
    if (int(X / N)):
        return ntok(int(X / N), N) + str(X % N)
    return str(X % N)

print(len(ntok(n, k)))
n,k = map(int, input().split())
count = 0
while True:
    n = n//k
    count += 1
    if n == 0:
        print (count)
        exit (0)
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 = 35
x2 = Base_10_to_n(N,K)
print(len(x2))#"100011"が表示される
n, k = map(int, input().split())
num = 0
while n != 0:
  n = n // k
  num += 1
 
print(num)
import numpy as np
n,k=map(int,input().split())
print(len(np.base_repr(n,base=k)))
n,k = map(int,input().split())
import math
print(int(math.log(n)/math.log(k))+1)
N, K = map(int, input().split())
c = 1
while N//K != 0: 
  N = N//K
  c += 1
print(c)
def change(x, n):
    if(int(x/n)):
        return change(int(x/n),n) + str(x%n)
    return str(x%n)
n, k = map(int, input().split())
print(len(list(change(n,k))))
n,k=map(int,input().split())
ans=0
while n>0:
  n//=k
  ans+=1
print(ans)
n, k = map(int, input().split())

ans = ""
while True:
    n, m = divmod(n, k)
    ans += str(m)
    if n == 0:
        break
print(len(ans))
n,k = map(int,input().split())
res = 0
while True:
    if n >= k:
        n = n // k
        res += 1
    else:
        break
print(res+1)
N, B = map(int, input().split())

tmp = B
ans = 1
while True:
  if tmp - 1 >= N:
    break
  tmp *= B
  ans += 1
  
print(ans)
import math
N, K = map(int, input().split())
print(math.floor(math.log(N, K)) + 1)
n, k = map(int, input().split())

c = 0
while n:
    n //= k
    c += 1
print(c)
import numpy as np


def solve():
    ans = len(str(np.base_repr(n, k)))
    return ans


n, k = [int(i) for i in input().split(" ")]
print(solve())
n, k = map(int, input().split())

cnt = 0
while n > 0:
    n //= k
    cnt += 1

print(cnt)
import math

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

count = 0
val = math.floor(N/K)
while val > 0:
    val=math.floor(val/K)
    count += 1

print(count+1)
n,k=map(int,input().split())
def main(n,k):
    if n//k:
        return main(n//k,k)+str(n%k)
    return str(n%k)
print(len(main(n,k)))
N,K=map(int,input().split())

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

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

ret = 0
while N != 0 :
  N //= K
  ret += 1
  
print(ret)
def keisan2(n,k,depth):
    n = n//k
    if n == 1:
        return depth+1
    elif n == 0:
        return depth
    else:
        return keisan2(n,k,depth+1)
n,k = map(int,input().split())
print(keisan2(n,k,1))
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N, K = rl()

num = []
while N > 0:
	num.append(N % K)
	N = N // K
print(len(num))
if __name__ == "__main__":
    n,k = (int(x) for x in input().split())
    ans = 0
    while n>0:
        n//=k
        ans += 1
    print(ans)
n,k = map(int, input().split())
ans = 0
while(n / k != 0):
  n //= k
  ans += 1
print(ans)
N,K = map(int,input().split())
ans_list = []

while N >= K:
    a = N % K
    ans_list.append(a)
    N = N / K

ans_list.append(N / K)

print("{}".format(len(ans_list)))
# coding: utf-8

n, k = [int(x) for x in input().rstrip().split(" ")]

k_base_num = []

while True:
  k_base_num.append(n%k)
  n = n//k
  if n == 0:
    break
print(len(k_base_num))
N, K = map(int, input().split())

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

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

digits = 1

while n >= k:
    n = n//k
    digits += 1

print(digits)
n,k=map(int,input().split())
cnt=0
while n:
    n//=k
    cnt+=1
print(cnt)
N, K = map(int, input().split())
ans = 0

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

print(ans)
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)
print(len(Base_10_to_n(n,k)))
n, k = map(int, input().split())

r = 0
while k ** r <= n:
  r +=1
print(r)
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()

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

for i in range(10000000):
    #print("i={}, n={}, k={}".format(i,n,k))
    #print(k**i)
    if k**i > n:
        break

print(i)
n, k = map(int, input().split())
cnt = 0
x = 1
while n >= x:
    x *= k
    cnt += 1
print(cnt)
n,k=map(int,input().split())
ans=1
for i in range(n):
    if n<k**ans:
        break
    else:
        ans+=1
print(ans)
import math
def f(x, n):
    if x//n:
        return f(x//n, n) + str(x%n)
    return str(x%n)
n, k = map(int, input().split())
print(len(f(n, k)))
import sys
readline = sys.stdin.readline


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

i = 1
while True:
    N = N // K
    if N == 0:
        break
    i += 1

print(i)
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)


N,R = map(int,input().split())
res = base10to(N, R)
print(len(res))
nk =  list(map(int, input().split()))
a = nk[0]
count = 1

while a/nk[1] >= nk[1] :

    a=a/nk[1]

    count+=1

if count > 1:
    count+=1

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

count = 0

while True:
    temp = K**count
    if temp > N:
        break
    count += 1

print(count)
N, K = map(int, input().split())
s = 0
while N >= K**s:
    s = s+1
print (s)
N, K = map(int, input().split())
ans = ""
while N > 0:
  ans = ans + str(N % K)
  N = N // K
print(len(ans))
import numpy as np

NK=np.array(input().split(),dtype=np.int32)

N=NK[0]
K=NK[1]

count=1
th=K
while(True):
    if(N>=th):
        count+=1
        th=th*K
    else:
        break

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

aa = []
while N > 0:
    # print(N)
    # print("a", N % K)
    aa.append(N % K)
    N = N // K

aa = list(reversed(aa))
# print(aa)
print(len(aa))
N, K = [int(n) for n in input().rstrip().split(' ')]

ans = 0

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

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

digit = 1
while n >= k:
    n //= k
    digit += 1

print(digit)
import math

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

print(math.floor(math.log(N, K)) + 1)
N, K = map(int, input().split())
D = 0
while N:
  N //= K
  D += 1
print(D)
n,k = map(int,input().split())
n2 = k
count = 0
while n2 <= n:
  n2*=k
  count+=1
print(count+1)
list = list(map(int, input().split()))

a=list[0]
b=list[1]
c=0
while a>0:
	a=a//b
	c=c+1
print(c)
N, R = map(int, input().split())

i = 0
while True:
  N = N // R
  i += 1
  if N == 0:
    print(i)
    break
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
N,K=map(int,input().split())
x = Base_10_to_n(N,K)
print(len(x))
N,K = (int(i) for i in input().split())

count = 0

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

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

while True:
    if N == 0:
        break
    N = N // K
    ans += 1


print(ans)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def dig(X, n):
    if (int(X / n)):
        return dig(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    N, K = map(int, input().split())
    print(len(dig(N, K)))


if __name__ == "__main__":
    main()
N, K = map(int, input().split())
ans = 0
k = 1
while N >= k:
  ans += 1
  k *= K
print(ans)
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(N: int, K: int):
    print(int(math.log(N)/math.log(K))+1)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)


if __name__ == '__main__':
    main()
n, k = map(int, input().split())
x, ans = k, 1
while x <= n: x *= k; ans += 1
print(ans)
n, k = (int(z) for z in input().split())
ans = 0
while n:
  n //= k
  ans += 1
print(ans)
N, K = tuple(list(map(int, input().split(' '))))
count = 1
while True:
    if N < K:
        break
    else:
        N = int(N / K)
        count += 1

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

c = 1
i = 1
while True:
    if n < k ** i:
        print(c)
        break
    c +=1
    i +=1
# Digits
N, K = map(int, input().split())
div = N // K
digits = []
while div > K:
    div = N // K
    digits.append(str(N % K))
    N   = div
digits.append(str(N % K))
if N // K != 0:
    digits.append(str(N // K))
ans = len(digits)
print(ans)
import math

def main():
    n,k = map(int, input().split())

    if n == 1:
        print(1)
        return
    print(math.ceil(math.log(n, k)))


if __name__ == '__main__':
    main()
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)

def main():
    N, K = map(int, input().split())
    nsin = Base_10_to_n(N, K)
    print(len(nsin))

if __name__ == '__main__':
    main()
n,k=map(int,input().split())
ans=0
while n:
    n//=k
    ans+=1
print(ans)
#python3
def main():
    n, k = map(int, input().split())
    i = 0
    while n:
        n = n//k
        i+=1
    print(i)
main()
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

a = list(map(int, input().split()))
print(len(base10to(a[0], a[1])))
N, K = (int(x) for x in input().split())


def base_10_to(n, b):
    if int(n / b):
        return base_10_to(int(n / b), b) + str(n % b)
    return str(n % b)


print(len(base_10_to(N, K)))
N,R=map(int,input().split())
for i in range(1000000000):
	if R**i>N:
		print(i)
		break
n, r = map(int,input().split())

i=1
rr=r
while rr <= n:
    i+=1
    rr=rr*r
print(i)
n, k = map(int, input().split())
t = k
ans = 1
while t <= n:
  t = t * k
  ans += 1
print(ans)
n, k = map(int, input().split())
ret = 1
while n // k != 0:
    ret += 1
    n = n // k
print(ret)
N, K = map(int, input().split())

ans = 1

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

print(ans)
N, K = [int(x) for x in input().split(" ")]

i=1
x=K

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

print(i)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,k = map(int , input().split())
i = 0
while pow(k, i)<=n:
    i += 1
print(i)
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,k = LI()
cnt = 0
tmp = 1
while tmp <= n:
    tmp *= k
    cnt += 1
print(cnt)
n , k = map(int,input().split())
ans = []

while n >= k:
    ans.append(n%k)
    n = n//k
ans.append(n)

print(len(ans))
inpl = lambda: list(map(int,input().split()))
N, K = inpl()
n = 1
ans = 0
while n <= N:
    n *= K
    ans += 1
print(ans)
N,K = map(int,input().split())
#A = list(map(int,input().split()))
count = 0
while N >= K**count:
    count += 1
print(count)
s, k = map(int,input().split())
c = []
while s > 0:
    a = s % k
    c.append(a)
    s //= k

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

count = 0

while n // k >= 1:
  n = n // k
  count += 1

print(count + 1)
#!/usr/bin/python3
# -*- coding:utf-8 -*-

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

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

count = 1

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

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

ANS=0
while N:
    N-=N%(K**ANS)
    ANS+=1
print(ANS-1)
n,k=map(int,input().split())

ans=0
for i in range(10**12):
  if n<k**i:
    ans=i-1
    break
print(ans+1)
from sys import stdin


def convert(n, k):
    tmp = n
    ans = ''
    while tmp > 0:
        ans += str(tmp % k)
        tmp = tmp // k
    return ans


def main():
    n, k = map(int, stdin.readline().split())
    print(len(convert(n, k)))


if __name__ == "__main__":
    main()
n, k = [int(i) for i in input().split()]
def decNbin(t, n):
  a = []
  while t!= 0:
    a.append(t % n)
    t  = t // n
  a.reverse()
  return a
print(len(str("".join(map(str, decNbin(n, k))))))
n,k = map(int,input().split())
c = 0
while n >= k:
    n = n // k
    c = c + 1

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

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

print(ans)
import sys
l = sys.stdin.readline()
n, k = map(int, l.split())
if n == 0:
  print(1)
  sys.exit(0)
count = 0
while n > 0:
    n //= k
    count += 1
print(count)
N, K = [int(_) for _ in input().split()]

ans = 0
while N > 0:
    N //= K
    ans += 1
print(ans)
import math

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

ans=math.floor(math.log(N,K))

print(ans+1)
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

n,k=list(map(int,input().split()))
x2=Base_10_to_n(n,k)
print(len(str(x2)))