N, K = [int(x) for x in input().split()]

l = []

while N > 0:
    l.insert(0, N % K)
    N = N // K

print(len(l)) int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x N, K = [int(x) for x in input().split()] N [int(x) for x in input().split()] K l = [] l [] while N > 0:
    l.insert(0, N % K)
    N = N // K N > 0 N 0 l.insert(0, N % K) l.insert l insert 0 N % K N K N = N // K N N // K N K print(len(l)) print len(l) len l N, K = [int(x) for x in input().split()] [int(x) for x in input().split()] N N = N // K N // K N K = [int(x) for x in input().split()] [int(x) for x in input().split()] K l = [] [] l
N, K = [int(x) for x in input().split()]

l = []

while N > 0:
    l.insert(0, N % K)
    N = N // K

print(len(l))
