N, K = map(int, input().split())

k_shinsu_list = []
while True:
    k_shinsu_list.append(N % K)
    N = N // K
    if N == 0:
        break
print(len(k_shinsu_list)) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K k_shinsu_list = [] k_shinsu_list [] while True:
    k_shinsu_list.append(N % K)
    N = N // K
    if N == 0:
        break True k_shinsu_list.append(N % K) k_shinsu_list.append k_shinsu_list append N % K N K N = N // K N N // K N K if N == 0:
        break N == 0 N 0 break print(len(k_shinsu_list)) print len(k_shinsu_list) len k_shinsu_list k_shinsu_list = [] [] k_shinsu_list N = N // K N // K N N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K
N, K = map(int, input().split())

k_shinsu_list = []
while True:
    k_shinsu_list.append(N % K)
    N = N // K
    if N == 0:
        break
print(len(k_shinsu_list))