sus = ['0','1','2','3','4','5','6','7','8','9']
def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n)
a,b = map(int,input().split())
print(len(base_sus(a,b))) sus = ['0','1','2','3','4','5','6','7','8','9'] sus ['0','1','2','3','4','5','6','7','8','9'] '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n) base_sus if dig == 0: return ""
     dig == 0 dig 0 return sus[dig%n]+base_sus(dig//n,n) sus[dig%n]+base_sus(dig//n,n) sus[dig%n] sus dig%n dig n base_sus(dig//n,n) base_sus dig//n dig n n dig dig n n a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b print(len(base_sus(a,b))) print len(base_sus(a,b)) len base_sus(a,b) base_sus a b def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n) def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n) base_sus a,b = map(int,input().split()) map(int,input().split()) a sus = ['0','1','2','3','4','5','6','7','8','9'] ['0','1','2','3','4','5','6','7','8','9'] sus b = map(int,input().split()) map(int,input().split()) b
sus = ['0','1','2','3','4','5','6','7','8','9']
def base_sus(dig,n):
    if dig == 0: return ""
    return sus[dig%n]+base_sus(dig//n,n)
a,b = map(int,input().split())
print(len(base_sus(a,b)))