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

num = ""
while(N > 0):
  num += str(N % K)
  N = int(N / K)

print(len(num)) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K num = "" num "" while(N > 0):
  num += str(N % K)
  N = int(N / K) N > 0 N 0 num += str(N % K) num str(N % K) str N % K N K N = int(N / K) N int(N / K) int N / K N K print(len(num)) print len(num) len num K = map(int, input().split()) map(int, input().split()) K num += str(N % K) str(N % K) num N = int(N / K) int(N / K) N num = "" "" num N, K = map(int, input().split()) map(int, input().split()) N
N, K = map(int, input().split())

num = ""
while(N > 0):
  num += str(N % K)
  N = int(N / K)

print(len(num))