n, k = map(int, input().split())
nbase = ''
tmp = n
while tmp > 0:
    nbase += str(tmp % k)
    tmp = int(tmp / k)

print(len(nbase)) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k nbase = '' nbase '' tmp = n tmp n while tmp > 0:
    nbase += str(tmp % k)
    tmp = int(tmp / k) tmp > 0 tmp 0 nbase += str(tmp % k) nbase str(tmp % k) str tmp % k tmp k tmp = int(tmp / k) tmp int(tmp / k) int tmp / k tmp k print(len(nbase)) print len(nbase) len nbase n, k = map(int, input().split()) map(int, input().split()) n tmp = n n tmp nbase += str(tmp % k) str(tmp % k) nbase tmp = int(tmp / k) int(tmp / k) tmp nbase = '' '' nbase k = map(int, input().split()) map(int, input().split()) k
n, k = map(int, input().split())
nbase = ''
tmp = n
while tmp > 0:
    nbase += str(tmp % k)
    tmp = int(tmp / k)

print(len(nbase))
