peterverebics/CodeNet_Python_118 huggingface dataset:
def conv(X, n):
    if (int(X/n)):
        return conv(int(X/n), n)+str(X%n)
    return str(X%n)

n, k = [int(_) for _ in input().split()]
print(len(conv(n, k)))
a = input().split()
b = int(a[0])
c = int(a[1])

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(b, c)))
N,K=input().split()
N=int(N)
K=int(K)
n=0
i=1
while i<=N:
  n=n+1
  i=K**n
print(n)
def main():
    def digit(x, n):
        x_tmp = x
        res = ''
        while x_tmp > 0:
            res += str(x_tmp % n)
            x_tmp = int(x_tmp/n)
        return len(res)

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

    print(digit(n, k))



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

n,k=map(int,input().split())
print(int(math.log(n)/math.log(k))+1)
n,k=map(int,input().split())
ans=0
while not n==0:
  n=n//k
  ans+=1
print(ans)
n, k = 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)


x = base_10_to_n(int(n), int(k))
print(len(x))
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 09:12:42 2020

@author: 17664
"""

a, k = map(int, input().split())
cnt = 0

while a:
    a //= k
    cnt += 1
    
print(cnt)
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())
cnt =0

while(n is not 0):
    n = int(n / k)
    cnt = cnt + 1

print(cnt)
number = list(map(int, input().split()))
i = 0

while number[1]**i <= number[0]:
  i += 1

print(i)
N, K = map(int, input().split(' '))
digit = 0
while N:
    N = int(N / K)
    digit += 1
print(digit)
import math

N, K = map(int, input().split())
log = math.log(N,K)
if float.is_integer(log):
    print(math.ceil(log)+1)
else:
    print(math.ceil(log))
def base10toq(n,q):
  if int(n/q): return base10toq(int(n/q),q)+str(n%q)
  return str(n%q)

n,k=map(int,input().split())
print(len(base10toq(n,k)))
n, k = map(int, input().split())
ans = 1
d = k
while n >= d:
    ans += 1
    d *= k
print(ans)
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

x2 = Base_10_to_n(n, k)

cnt=str(x2)
print(len(cnt))
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())
for i in range(10**9):
  if K**(i) <= N < K**(i+1):
    print(i+1)
    exit()
n,k=map(int,input().split())
for i in range(10**10):
  if k**i>n:
    print(i)
    exit()
from math import floor, log
N, K = map(int, input().split())

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

print(int(math.log(n,k)) + 1)
N, K = map(int,input().split())
def func(x):
  if 0 <= x < K:
    return 1
  else:
    return 1 + func(x // K)

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

count = 1

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

print(count)
A,B = map(int,input().split())
cnt = 0
#print(A,B)
if A < B:
  print(A)
  exit()
while B <= A:
  A = A // B
  cnt += 1
print(cnt + 1)
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    for i in range(10 ** 10):
        if n // pow(k, i) == 0:
            print(i)
            exit()


if __name__ == '__main__':
    solve()
import math
N,K = map(int,input().split())
ans = 1
while N >= K :
    N = math.floor(N/K)
    ans += 1
print(ans)
N,K=map(int, input().split())

num = 1

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

i = 1
while (K ** i) - 1 < N:
  i += 1

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

count = 1

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

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

    while n != 0:
        n -= n % (k ** i)
        i += 1

    print(i - 1)


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

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

cnt = 0

while(n > 0):
  n //= int(k)
  cnt += 1
  int(n)

print(cnt)
n,k = map(int,input().split())
f = 0
for i in range(31,-1,-1):
    p,q = divmod(n,k**i)
    if p!= 0:
        break
    n = q
print(i+1)
n,k=map(int,input().split())
l=[]
if k<=9 :
  while True:
    a=n%k
    if n>=k:
      l.append(a)
    n//=k
    if n<k :
      l.append(n)
      break
  print(len(l))
else:
  print(len(str(n)))
import math
n,k = map(int, input().split())
if n != 1:
    print(math.ceil(math.log(n,k)))
else:
    print(1)
from math import log, ceil

N, K = map(int, input().split())
res = ceil(log(N, K))
if res == 0:
    res = 1
print(res)
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(Base_10_to_n(n, k))
print(len(Base_10_to_n(n,k)))
a,b=map(int,input().split())

cnt=0
#if a%b==0:
#            cnt=0
while a>=b:
            a=a//b
            cnt+=1
            
print(cnt+1)
n, k = list(map(int, input().split()))
ans = 0
while n:
    n //= k
    ans += 1
print(ans)
N,K=map(int,input().split())
count=0
while(N>0):
    N//=K
    count+=1
print(count)
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

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

if __name__ == '__main__':
    main()
N,R=map(int, input().split())
i=0
while True:
 if(R**i<=N<R**(i+1)):
  print(i+1)
  break
 i+=1
s=input("")
l=s.split()
N=int(l[0])
K=int(l[1])
for i in range(10000):
    if N>=K**i and N<K**(i+1):
        print(i+1)
import math
N, K = map(int,input().split())
M = ""
while True:
  M = str(N%K) + M
  N = N//K
  if N//K ==0:
    M = str(N) + M
    break
if(M[0]=="0"): M = M[1:]
print(len(M))
n,k=list(map(int,input().split()))

for i in range(10000):
  if k**i>n:
    print(i)
    break
N,K=map(int,input().split())
c=0
while N>0:
  N//=K
  c+=1
print(c)
n,k=map(int,input().split())
x,i=0,0
while n>0:
    x+=(n%k)*10**i
    n=n//k
    i+=1
print(len(str(x)))
def convert(n, k):
    if (int(n/k)):
        return convert(int(n/k), k)+str(n%k)
    return str(n%k)
n,k=map(int,input().split())
print(len(convert(n,k)))
n, k = map(int, input().split())
cnt = 0
while n > 0:
    n //= k
    cnt += 1
print(cnt)
n,k=map(int,input().split())
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
print(len(base10to(n,k)))
N,K =map(int,input().split())
ans = 0
while True :
    if N < K :
        break
    else:
        N = N // K
        ans += 1
print(ans+1)
n,k = map(int, raw_input().split(' '))
def f(n,k):
	count = 0
	while(n):
		n /= k
		count +=1
	return count
print f(n,k)
n,k=map(int,input().split())

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



def kurai(n,k):
	for i in range(100):
		if k**(i) > n:
			return i



print(kurai(n,k))
import math

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

if float.is_integer(math.log(n, k)):
    print(math.ceil(math.log(n, k))+1)
else:
    print(math.ceil(math.log(n, k)))
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)))
#s = input()
#n = int(input())
n,k = map(int,input().split())
#lst1 = list(map(int,input().split()))
ans = 0
while True:
    if n//k >= 1:
        n//=k
        ans += 1
    else:
        ans += 1
        break
print(ans)
N,K = map(int,input().split())
ans = 1
while N>=K:
    ans += 1
    N//=K
print(ans)
def answer(n: int, k: int) -> int:
    digits = 0
    while 0 < n:
        n //= k
        digits += 1

    return digits


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


if __name__ == '__main__':
    main()
# coding: utf-8
# Your code here!

n,k = input().rstrip().split(' ')

n = int(n)
k = int(k)
K = k
count = 1

while(1):
    if K > n:
        print(count)
        break
    K = K*k
    count += 1
n,k=map(int,input().split())
a = 0
while  n >= k:
    a += 1
    n = n // k

print(a + 1)
a = input().split(" ")
suji = a[0]
sinsu = a[1]
count = int(0)

for i in range(100):
  if suji == 0:
    break
  else:
    suji = int(suji) // int(sinsu)
    count = count + 1 

print(count)
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
while True:
    if n // (k ** ans) == 0:
        break
    ans += 1
print(ans)
inputs=input().split(" ")
N=int(inputs[0])
K=int(inputs[1])
i=0

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

i+=1

print(i)
N, K = map(int,input().split())
ans = 0
while N > 0:
  N = N // K
  ans += 1
print(ans)
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(str(Base_10_to_n(N, K)) ))
n, k = (int(x) for x in input().split())
ans = 1
while True:
    if n <= k ** ans - 1:
        break
    ans += 1
print(ans)
#!/usr/bin/env python3

n,k = [int(i) for i in input().split()]

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

print(len(ans))
NN = 2020202
MOD = 10**9+7
INF = float("inf")

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

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

for i in range(100000):
    if N // (K**i) == 0:
        print(i)
        break
N, K = list(map(int, input().split()))
c = 1
for _ in range(10**15):
    N = (N - N % K) // K
    if N == 0:
        break
    c += 1
print(c)
import math
n,k = map(int,input().split())
print(int(math.log(n,k)+1))
import math
N,K = list(map(int,input().split()))
print(int(math.log(N,K))+1)
num = input().split()

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

total = 0

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

print(total)
def main():
    a, b = list(map(int, input().split()))
    flag = 1
    d = 1
    while flag:
        if b**d > a:
            flag = 0
        else:
            d += 1
    print(d)


if __name__ == "__main__":
    main()
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
x2 = Base_10_to_n(N, K)
print(len(x2))
def main():
    n, k = map(int, input().split())
    cnt = 0
    i = 1
    # nが大きい
    while n >= i:
        i *= k
        cnt += 1
    print(cnt)

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

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

ans = int(math.log(N,K)) + 1 

print(ans)
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(str(Base_10_to_n(n, k))))
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():
    import sys
    input = sys.stdin.readline
    N,K = map(int,input().split())
    print(len(Base_10_to_n(N, K)))


if __name__ == "__main__":
    main()
score = list(map(int,input().split()))
keta = 0
answer = 1
while score[0] >= answer:
    answer *= score[1]
    keta += 1
print(keta)
n,k=map(int,input().split())
def f(x,n):
  if (int(x/n)):
    return f(int(x/n),n)+str(x%n)
  return str(x%n)
print(len(f(n,k)))
n, k = map(int,input().split())
c = 0
while n >= k:
    n = n//k
    c += 1
print(c+1)
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

import math

n,k=nm()

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

i = 0
while True:
  if K ** i > N:
    print(i)
    exit()
  i += 1
n, k = map(int, input().split())
x = k
cnt = 1
while n >= x:
    x *= k
    cnt += 1
print(cnt)
def base10(x,n):
  x_dumy = x
  out = ''
  while x_dumy > 0:
    out = str(x_dumy%n)+out
    x_dumy = int(x_dumy/n)
  return len(out)

A = list(map(int, input().split()))
print(base10(A[0],A[1]))
n, k = map(int, input().split())
c = 0
while n > 0:
    n = n // k
    c += 1

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

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

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

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N,K=input_int()

import math

print(int(math.log(N,K)+1))
N, K = map(int, input().split())
ans = 0
now = 1
while now <= N:
    now *= K
    ans += 1

print(ans)
x,k=map(int,input().split())
ans=0
while k**ans<=x:
  ans+=1

print(ans)
N,K = map(int, input().split())
c=0
while N > 0:
  N //= K
  c+= 1
  
print(c)
N,K=map(int,input().split())
n=0
while N==N:
    if K**n<=N<K**(n+1):
        break
    else :
        n+=1
print(n+1)
InputValue = input().split(' ')

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

MaxN = 10
for i in range(9):
    MaxN = MaxN * 10

Count  = 1
if 1<=N<=MaxN and 2<=K<=10:
    Result = N // K
    while Result > 0:
        Result = Result // K
        Count+=1
print (Count,end='\n')
import math

n, k = map(int, input().split())
print(math.floor(math.log(n, k) + 1))
a = input().split()
x = int(a[0])
y = int(a[1])
z = int(x/y)
n = 1
while z>=1:
        z = int(z/y)
        n = n+1
print(n)
def Base_10_to_n(num, n):
    if (int(num/n)):
        return Base_10_to_n(int(num/n), n)+str(num%n)
    return str(num%n)

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

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

print(ans)
def sisuu(X, n):
    if (int(X/n)):
        return sisuu(int(X/n), n) + str(X%n)
    return  str(X%n)

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

hennkan = sisuu(N, K)
ketasuu = len(str(hennkan))

print(ketasuu)
N, K = map(int, input().split())
i = 1

def func(i):
    while True:
        if N < K ** i:
            return i
        i += 1

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

i = 1
temp = k

while n >= k**i:
    i += 1
print(i)
n, k = [int(i) for i in input().split()]

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

i = 0
while 1:
    if K ** (i+1) > N >= K ** i:
        break
    i += 1

print(i+1)
N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

ans=0

while True:
	
	if N<(K**ans): break
	
	ans+=1


print(ans)
def main():
    n, k = map(int, input().split())
    count = []
    while n != 0:
        count.append(n % k)
        n = n // k
    print(len(count))


if __name__ == "__main__":
    main()
n, k = (int(i) for i in input().split());

res = 0;

while n > 0:
    res += 1;
    n //= k;

print(res);
n,k = list(map(int,input().split()))
for i in range(100):
  if k**i <= n < k**(i+1):
    print(i+1)
N,K=map(int, input().split())
ans = 0
while (N > 0):
  N //= K
  ans += 1
print(ans)
N, K = map(int, input().split())
c = 0
while True:
  if K**c<=N:
    c+=1
    continue
  else:
    break
print(c)
n, k=map(int, input().split())
box = []
a = n
b = n
while a>0:
    a, b = divmod(a,k)
    box.append(b)
#print(box)

l = len(box)
print(l)
#tot = ''
#for i in range(l):
#    tot = tot + str(box[l-1-i] * k**i)
#print(tot)
#print(len((tot)))
N, K = map(int, input().split())
cnt = 0

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

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

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

num = ""
while(N > 0):
  num += str(N % K)
  N = int(N / K)

print(len(num))
n, k = map(int, input().split())
if n <= k-1:
    print(1)
else:
    n -= (k-1)
    for s in range(1, 1000000000):
        if n > (k**s)*(k-1):
            n -= (k**s)*(k-1)
        else:
            print(s+1)
            break
inp = input().split()
n = int(inp[0])
k = int(inp[1])
count = 1
w = k
while ((n//w) > 0):
    w = w * k
    count += 1
print(count)
N, K = map(int, input().split())
i = 0
while N > 0:
    N = N // K
    i += 1
print(i)
def Ten_to_n(X, n):
    if (int(X / n)):
        return Ten_to_n(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    B = list(map(int, input().split()))
    #     # # [1,2,3]
    res = Ten_to_n(B[0], B[1])
    print(len(res))


main()
input = input()

arr = input.split(" ")
N = int(arr[0])
K = int(arr[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

R = Base_10_to_n(N, K)

print(len(str(R)))
N, K = map(int, input().split())
ans = []
while True:
    if N // K == 0:
        ans.append(N)
        break
    ans.append(N%K)
    N //= K
print(len(ans))
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)
 
data_list = list(map(int,input().split(" ")))
ans = Base_10_to_n(data_list[0], data_list[1])
print(len(ans))
N,K = map(int, input().split())

Sum = 0

while True:
    Sum += 1

    if K ** Sum > N:
        break

print(Sum)
N, K = map(int, input().split())
count = 0
while N > 0:
  N = N//K
  count += 1
print(count)
if __name__ == '__main__':

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

	cnt = 1
	while True:
		if n % k == 0:
			n = n // k
		else:
			n = n - n % k
			n = n // k
		if n // k < k:
			if n // k == 0:
				if n % k == 0:
					pass
				else:
					cnt += 1
			else:
				cnt += 2
			break
		cnt += 1
			
	print(cnt)
n, k = map(int, input().split())

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

a = []

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

x = N % K

a.append(str(x))

ans = len(a)

print(ans)
n, k = map(int, input().split())
e=1
while pow(k, e) <= n:
  e+=1
print(e)
N,K = map(int, input().split())

ans = 0

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

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

ans = 0

while n != 0:
    n //= k
    ans += 1
print(ans)
from math import log
n, k = map(int, input().split())
print(int(log(n, k)) + 1)
N, K = map(int,input().split())
i=1
while N>=K:
    N = N//K
    i = i+1
print(i)
N,K = [int(x) for x in input().rstrip().split()]

s=N
a=0
ans=""
while s!=0:
    N=s
    s = N//K
    a = N%K
    ans += str(a)

print(len(ans))
N, K = list(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())
out = ""
n_dummy = n
while n_dummy > 0:
    out = str(n_dummy%k) + out
    n_dummy = int(n_dummy/k)
print(len(out))
N, K = map(int, input().split())
def transform(X, n):
    if (int(X/n)):
        return transform(int(X/n), n)+str(X%n)
    return str(X%n)

print(len(transform(N, K)))
s = input().split()
N = int(s[0])
K = int(s[1])

i = 0

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

ans = i
print(ans)
# 156 B  

n, k = map(int, input().split())
sum = ""
z = n

while z >= 1:
    sum = str((z % k)) + sum
    z = z // k

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

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

print(ans)
def x_base(n, x):
  j = []
  while(1):
    if(n < x):
      j.append(n)
      break
    else:
      j.append(n % x)
      n //= x
  return j


n = [int(i) for i in input().split()]
print(len(x_base(n[0], n[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)
  
x10 = n
x2 = Base_10_to_n(x10, k)
print(len(x2))
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
while n>0:
    n = n//k
    ans+=1
print(ans)
n, k = map(int, input().split())
a = 1
while k**a <= n:
    a += 1
print(a)
n,k=map(int,input().split())
ans=0
while n>0:
    n//=k
    ans+=1
print(ans)
n,k = map(int,input().split())

c=1
while n >= k:
  n = int(n/k)
  c += 1
print(c)
import math
n,b = map(int, input().split())
dig = (math.floor(math.log(n) / math.log(b)) + 1)
print(dig)
def resolve():
    n, k = map(int, input().split())
    arr = []
    while n > 0:
        arr.append(n % k)
        n = n // k
    print(len(arr))

if __name__ == '__main__':
        resolve()
n, k = map(int, input().split())
i = 0
while True:
  if n // pow(k, i) == 0:
    print(i)
    break
  else:
    i += 1
n, k = map(int, input().split())
x = 1
ans = 0

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

import math 

def findNumberOfDigits(n, base): 
       
    dig = (math.floor(math.log(n) /
                 math.log(base)) + 1) 
      
    print(dig)
  
  
# calling the method 
findNumberOfDigits(n, k)
# -*- coding: utf-8 -*-

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

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

n = math.log(N, K)
if n == math.floor(n):
  print(math.ceil(n)+1)
else:
  print(math.ceil(n))
n, k = map(int , input().split())
digits = 0
while(n > 0):
    n = n//k
    digits = digits + 1
print(digits)
n,k =  map(int,input().split())
cnt = 0
ans = n//k
n = ans
while ans != 0:
    cnt += 1
    ans = n//k
    n = ans
print(cnt+1)
N, K = map(int, input().split())
answer = 0
while N // (K ** answer) >= 1:
    answer += 1
print(answer)
str = input().split()
N = int(str[0])
K = int(str[1])
result = N
counta = 0
while True:
	result = result/K
	if(result<1):
		counta+=1
		break
	else:
		counta+=1
print(counta)
import math


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

ans = math.floor(1 + math.log(N)/math.log(K))
print(ans)
N, M = map(int, input().split())
X = int(M)
ans = 1
while N >= X:
  ans += 1
  X = X * M
print(ans)
N, K = map(int,input().split())
i=0
while N>=K**i:
  i=i+1
print(i)
import math
n,k=map(int,input().split())
x=math.log(n,k)
print(int(x)+1)
N,K=map(int,input().split())
for i in range(100):
    if K**i<=N<K**(i+1):
        print(i+1)
        break
N, K = map(int, input().split())

count = 0

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

D = 1
while True:
    if N//K >0:
        D += 1
        N = N//K
    else:
        break

print(D)
n,k = map(int,input().split())
a = []
while n > 0:
  a.append(n % k)
  n //= k
print(len(a))
N, K = map(int,input().split())
ans = 0
while N >= 1:
    N /= K
    ans += 1
print(ans)
N,K = map(int, input().split())

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

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

def solve():
    for i in range(1, 1000000):
        if n < k ** i:
            return i

print(solve())
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)
a=Base_10_to_n(N,K)
print(len(a))
N,K=(int(i)for i in input().split())

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

print(result)