def check(n,k):
  r=[]
  while n>0:
    r.append(n%k)
    n//=k
  return len(r)
n,k=map(int,input().split())
print(check(n,k)) def check(n,k):
  r=[]
  while n>0:
    r.append(n%k)
    n//=k
  return len(r) check r=[] r [] while n>0:
    r.append(n%k)
    n//=k
   n>0 n 0 r.append(n%k) r.append r append n%k n k n//=k n k return len(r) len(r) len r n n k k n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k print(check(n,k)) print check(n,k) check n k n,k=map(int,input().split()) map(int,input().split()) n k=map(int,input().split()) map(int,input().split()) k def check(n,k):
  r=[]
  while n>0:
    r.append(n%k)
    n//=k
  return len(r) def check(n,k):
  r=[]
  while n>0:
    r.append(n%k)
    n//=k
  return len(r) check
def check(n,k):
  r=[]
  while n>0:
    r.append(n%k)
    n//=k
  return len(r)
n,k=map(int,input().split())
print(check(n,k))