def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K)

N, K = map(int, input().split())
ans = len(base10toK_base(N, K))
print(ans)  def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K) base10toK_base if num // K:
        return base10toK_base(num//K, K) + str(num % K)
     num // K num K return base10toK_base(num//K, K) + str(num % K) base10toK_base(num//K, K) + str(num % K) base10toK_base(num//K, K) base10toK_base num//K num K K str(num % K) str num % K num K return str(num % K) str(num % K) str num % K num K num num K K N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K ans = len(base10toK_base(N, K)) ans len(base10toK_base(N, K)) len base10toK_base(N, K) base10toK_base N K print(ans) print ans N, K = map(int, input().split()) map(int, input().split()) N def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K) def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K) base10toK_base ans = len(base10toK_base(N, K)) len(base10toK_base(N, K)) ans K = map(int, input().split()) map(int, input().split()) K
def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K)

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