def baseConv(n,ro,ri=10):
    n = int(str(n),base=ri)
    s = ""
    nums = "0123456789abcdefghijklmnopqrstuvwxyz"
    while n:
        s += nums[n%ro]
        n //= ro
    return s[::-1]
  
n,k = map(int,input().split())
print(len(baseConv(n,k))) def baseConv(n,ro,ri=10):
    n = int(str(n),base=ri)
    s = ""
    nums = "0123456789abcdefghijklmnopqrstuvwxyz"
    while n:
        s += nums[n%ro]
        n //= ro
    return s[::-1]
   baseConv n = int(str(n),base=ri) n int(str(n),base=ri) int str(n) str n base=ri base ri s = "" s "" nums = "0123456789abcdefghijklmnopqrstuvwxyz" nums "0123456789abcdefghijklmnopqrstuvwxyz" while n:
        s += nums[n%ro]
        n //= ro
     n s += nums[n%ro] s nums[n%ro] nums n%ro n ro n //= ro n ro return s[::-1] s[::-1] s ::-1 -1 n n ro ro ri=10 ri 10 n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k print(len(baseConv(n,k))) print len(baseConv(n,k)) len baseConv(n,k) baseConv n k n,k = map(int,input().split()) map(int,input().split()) n k = map(int,input().split()) map(int,input().split()) k def baseConv(n,ro,ri=10):
    n = int(str(n),base=ri)
    s = ""
    nums = "0123456789abcdefghijklmnopqrstuvwxyz"
    while n:
        s += nums[n%ro]
        n //= ro
    return s[::-1]
   def baseConv(n,ro,ri=10):
    n = int(str(n),base=ri)
    s = ""
    nums = "0123456789abcdefghijklmnopqrstuvwxyz"
    while n:
        s += nums[n%ro]
        n //= ro
    return s[::-1]
   baseConv
def baseConv(n,ro,ri=10):
    n = int(str(n),base=ri)
    s = ""
    nums = "0123456789abcdefghijklmnopqrstuvwxyz"
    while n:
        s += nums[n%ro]
        n //= ro
    return s[::-1]
  
n,k = map(int,input().split())
print(len(baseConv(n,k)))