Given is an integer N. Find the number of digits that N has in base K.

-----Notes-----
For information on base-K representation, see Positional notation - Wikipedia.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 10^9
 - 2 \leq K \leq 10

-----Input-----
Input is given from Standard Input in the following format:
N K

-----Output-----
Print the number of digits that N has in base K.

-----Sample Input-----
11 2

-----Sample Output-----
4

In binary, 11 is represented as 1011.

Difficulty: introductory

Starter code:

Solutions:
n, k = list(map(int, input().split()))
ans = 0

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

print(ans)


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

while 1 > 0:
  n = n // K
  if n == 0:
    print(i)
    break
  i += 1

n,k = map(int,input().split())
l = []
while n != 0 :
    r = divmod(n,k)
    n = r[0]
    l.append(r[1])
print(len(l))


n,k = list(map(int, input().split()))
i=0
a=[]

while n!=0:
    a.append(n%k)

    n=n//k
    i=i+1

print((len(a)))






N, K=map(int, input().split())
count=0
while True:
    if N >= pow(K, count):
        count+=1
    else:break
print(count)

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)

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

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

nk = list(map(int, input().split()))
n, k = nk[0], nk[1]
digit = 0

while n > k ** digit - 1:
    digit += 1

print(digit)


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

ans = 1
while(True):
    n = n//k
    if(n == 0):
        break
    ans += 1

print(ans)

import math  
def findNumberOfDigits(n, b): 
    dig = (math.floor(math.log(n) /math.log(b)) + 1) 
    return dig
n, k = map(int, input().strip().split())
print(findNumberOfDigits(n, k))

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

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

for a in range(10**9):
    if k**a > n:
        print(a)
        break

#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    #print(q)
    #print(mod)
    if q <=0 :
        break
if mod_list[-1] == 0:
    result = len(mod_list) - 1
else:
    result =len(mod_list)
print(result)

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

power = 1

while True:
    if N < K ** power:
        break
    else:
        power += 1

print(power)

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


n, k = map(int, input().split())
lists = []

while True:
    if n < k:
        lists.append(n)
        break
    n, b = divmod(n, k)
    lists.append(b)

ans_list = reversed(lists)
print(len(''.join(map(str, ans_list))))

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

for i in range(10 ** 9):
    if n < k ** i:
        print(i)
        break


#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    if q <=0 :
        break

n_ary = int("".join(map(str,mod_list[::-1])))
print(len(str(n_ary)))

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

n, k = map(int, input().split())
lists = []

while True:
    if n < k:
        lists.append(n)
        break
    n, b = divmod(n, k)
    lists.append(b)

ans_list = reversed(lists)
print(len(''.join(map(str, ans_list))))

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

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

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

print(i)


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

print(keta)

def readinput():
    n,k=list(map(int,input().split()))
    return n,k

def main(n,k):
    keta = 0
    while n > 0:
        keta += 1
        r = n % k
        n = n // k
    return keta

def __starting_point():
    n,k=readinput()
    ans=main(n,k)
    print(ans)

__starting_point()

import os, sys, re, math

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

d = 0
a = K ** 0
while a <= N:
    d += 1
    a *= K

print(d)


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

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

def L():
  return list(map(int, input().split()))
import math
[n,k]=L()

print(math.floor(math.log(n,k))+1)

n, k = list(map(int, input().split()))
lists = []
ans = 0

while int(n) > 0:
    n, b = divmod(n, k)
    ans += 1

print(ans)


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

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

ans = 0;
while(n):
    n = int(n / k)
    ans += 1

print(ans)

n,k=map(int,input().split())
total=[]

while True:
    if n>=k:
        total.append((n%k))
        n=n//k
    if n<k:
        total.append((n))
        break
print(len(total))

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

digit = 0

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

print(digit)

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

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))


def __starting_point():
    main()
__starting_point()

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

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

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)

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


#abc156b
n,k = map(int,input().split())
for i in range(1000):
    if k**i <= n and n <= k**(i+1)-1:
        print(i+1)
        break

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

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

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


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

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

import math
n, k = map(int, input().split())
x = int(math.log(n)//math.log(k)) + 1
print(x)

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

def main():
	t, n = list(map(int, input().split()))
	binary = 0
	ctr = 0
	temp = t  
#calculating binary
	while(temp > 0):
		binary = ((temp%n)*(10**ctr)) + binary
		temp = int(temp/n)
		ctr += 1
	return len(str(binary))

def __starting_point():
    print((main()))

__starting_point()

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

n = 1

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

print(n)

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

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

print(ans)

# 整数NをK進数で表したとき、何桁になるかを求めてください。

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

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

print(i)

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

ans = 0

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

print((ans + 1))


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 >= 1:
    ans = N // K
    N = ans 
    count += 1

print(count)

N, K = map(int, input().split())
# Nが十進数のとき、NよりKのi乗が超えた数のとき、
# iがK進数の桁数
for i in range(10 ** 9):
    if N < K ** i:
        print(i)
        break

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

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

def ans156(N:int, K:int):
    length=1#0桁はないため、1からスタート
    while True:
        if N<K:
            break
        N=int(N/K)#割り切れるごとに1桁ずつ増えていく。
        length+=1
    return length

print(ans156(N,K))

n, k = map(int, input().split())
lists = []
ans = 0

while True:
    if n < k:
        ans += 1
        break
    n, b = divmod(n, k)
    ans += 1

print(ans)

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

# 整数N を K進数 で表したとき、何桁になるかを出力
# 位取り記数法：https://xtech.nikkei.com/atcl/learning/lecture/19/00049/00001/

digit = 0

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

print(digit)

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

print(cnt+1)

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

N,K=map(int,input().split())
rank=1
S=K

while N>=S:
  rank+=1
  S*=K
#  print(S)
  
print(rank)

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

while n > 0:
    n = 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())
i = 0
while K ** i <= N:
    i += 1
print(i)

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

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

# 余りを付け加えていく文字列を定義
ans_str = ''

# 割り算の商を表す変数を定義
n = N

while (n>=K):
    n = n//K
    ans_str += str(n%K)
    # print(f'n：{n}')
ans_str += str(n)
# print(ans_str[::-1])
print(len(ans_str))

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

D = []
while (N > 0):
    D.append(N % K)
    N = N // K

print(len(D))

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


import queue
N,K = map(int,input().split())
ans = queue.Queue()
while N >= K:
    N,amari = divmod(N,K)
    ans.put(amari)
ans.put(N)
answer = ""
while not ans.empty():
    answer += str(ans.get())
print(len(answer))

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

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

print(count)

N,K=list(map(int,input().split()))
answer=1

if K==10:
  Str=str(N)
  answer=len(Str)
  print(answer)
  return

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

print(answer)


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

i = 0
anslist = []
while True:
  if N>=K:
    i+=1
    anslist.append(N%K)
    N = N//K
    #print (N)
  if N<K:
    anslist.append(N)
    i+=1
    break
    
anslist.reverse()
#print (anslist)
#print (''.join(map(str, anslist)))
print (i)

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

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

print(count)

n,k=map(int,input().split())
num=k
ans=1
while num-1<n:
    ans+=1
    num*=k
print(ans)

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

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

print(n)
return

import math
n,k=list(map(int,input().split()))
a=int(math.log(n,k))+1
print(a)


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

answer = n // k
count = 1
while 0 < answer:
    answer = answer // k
    count += 1

print(count)


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

N, K = map(int, input().split())
print(sum(N >= K ** i for i in range(99)))

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)

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


integer, base = map(int, input().split())
converted_number = ''
while integer > 0:
    converted_number += str(integer % base)
    integer //= base
print(len(converted_number[::-1]))

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

def calc_digits(n: int, k: int) -> str:
    if int(n / k):
        return calc_digits(int(n / k), k) + str(n % k)

    return str(n % k)


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

print((len(calc_digits(n, k))))


N,K=map(int,input().split())
i = 0
while N >= K ** i :
    i += 1
else :
    print(i)

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

m = 0
while True:
    m += 1
    if k**m > n:
        print(m)
        break

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

ans = []
while n > 0:
  ans.append(n % k)
  n /= k
  n = int(n)
print(len(ans))

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

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



n,k=map(int,input().split());p=[]
while n:
  p.append(n%k)
  n//=k
print(len(p))

def main():
  N, K = map(int, input().split())
  
  if N < K:
    print(1)
    return

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

  print(cnt)


main()

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

while (n > 0):
    l.append(n%k)
    n //= k
print((len(l)))


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

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

def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K)

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

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

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

print(ans)


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

n = input()
n = n.split()
k = int(n[1])
n = int(n[0])
a = 1
b = 0
while a == 1:
    b = b + 1
    if k**b>n:
        a = 0
print(b)

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

ans = 0
x = 1

while x <= N:
  x *= K
  ans +=1
  
print(ans)


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

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

# kのべき乗でnを超える最大の冪数を求める
# 最大の冪数から順にとり尽くしていく
# 再帰で書ける？

def max_beki(number, k):
    beki = 0
    while k**beki <= number:
        beki += 1
    return beki

res = []
waru_kazu = k**(max_beki(n, k) - 1)
while waru_kazu >= 1:
    shou = n//waru_kazu
    res.append(str(shou))
    n -= shou*waru_kazu
    waru_kazu /= k

print(len(res))