def Base_10_to_n(X, n):
    if int(X/n):
        return Base_10_to_n(int(X/n), n) + str(X%n)
    return str(X%n)

N, K = map(int, input().split())
print(len(Base_10_to_n(N,K))) def Base_10_to_n(X, n):
    if int(X/n):
        return Base_10_to_n(int(X/n), n) + str(X%n)
    return str(X%n) Base_10_to_n if int(X/n):
        return Base_10_to_n(int(X/n), n) + str(X%n)
     int(X/n) int X/n X n return Base_10_to_n(int(X/n), n) + str(X%n) Base_10_to_n(int(X/n), n) + str(X%n) Base_10_to_n(int(X/n), n) Base_10_to_n int(X/n) int X/n X n n str(X%n) str X%n X n return str(X%n) str(X%n) str X%n X n X X n n N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K print(len(Base_10_to_n(N,K))) print len(Base_10_to_n(N,K)) len Base_10_to_n(N,K) Base_10_to_n N K N, K = map(int, input().split()) map(int, input().split()) N def Base_10_to_n(X, n):
    if int(X/n):
        return Base_10_to_n(int(X/n), n) + str(X%n)
    return str(X%n) def Base_10_to_n(X, n):
    if int(X/n):
        return Base_10_to_n(int(X/n), n) + str(X%n)
    return str(X%n) Base_10_to_n K = map(int, input().split()) map(int, input().split()) K
def Base_10_to_n(X, n):
    if int(X/n):
        return Base_10_to_n(int(X/n), n) + str(X%n)
    return str(X%n)

N, K = map(int, input().split())
print(len(Base_10_to_n(N,K)))
