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

s = ""
while(True):
  if n < k :
    s += str(n)
    break
  else :
    s += str(n%k)
    n = n//k

print(len(s)) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k s = "" s "" while(True):
  if n < k :
    s += str(n)
    break
  else :
    s += str(n%k)
    n = n//k True if n < k :
    s += str(n)
    break
  else :
    s += str(n%k)
    n = n//k n < k n k s += str(n) s str(n) str n break s += str(n%k) s str(n%k) str n%k n k n = n//k n n//k n k print(len(s)) print len(s) len s n, k = map(int, input().split()) map(int, input().split()) n n = n//k n//k n s = "" "" s k = map(int, input().split()) map(int, input().split()) k s += str(n) str(n) s s += str(n%k) str(n%k) s
n, k = map(int, input().split())

s = ""
while(True):
  if n < k :
    s += str(n)
    break
  else :
    s += str(n%k)
    n = n//k

print(len(s))