a, b = map(int, input().split())
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

print(len(base10to(a,b))) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b) base10to if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
     int(n/b) int n/b n b return base10to(int(n/b), b) + str(n%b) base10to(int(n/b), b) + str(n%b) base10to(int(n/b), b) base10to int(n/b) int n/b n b b str(n%b) str n%b n b return str(n%b) str(n%b) str n%b n b n n b b print(len(base10to(a,b))) print len(base10to(a,b)) len base10to(a,b) base10to a b b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b) def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b) base10to
a, b = map(int, input().split())
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

print(len(base10to(a,b)))