#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    if q <=0 :
        break

n_ary = int("".join(map(str,mod_list[::-1])))
print(len(str(n_ary))) N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K q, mod = divmod(N,K) q divmod(N,K) divmod N K mod mod_list = [mod] mod_list [mod] mod while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    if q <=0 :
        break True q , mod =divmod(q,K) q divmod(q,K) divmod q K mod mod_list.append(mod) mod_list.append mod_list append mod if q <=0 :
        break q <=0 q 0 break n_ary = int("".join(map(str,mod_list[::-1]))) n_ary int("".join(map(str,mod_list[::-1]))) int "".join(map(str,mod_list[::-1])) "".join "" join map(str,mod_list[::-1]) map str mod_list[::-1] mod_list ::-1 -1 print(len(str(n_ary))) print len(str(n_ary)) len str(n_ary) str n_ary K = map(int,input().split()) map(int,input().split()) K N,K = map(int,input().split()) map(int,input().split()) N mod_list = [mod] [mod] mod_list n_ary = int("".join(map(str,mod_list[::-1]))) int("".join(map(str,mod_list[::-1]))) n_ary q, mod = divmod(N,K) divmod(N,K) q mod =divmod(q,K) divmod(q,K) mod mod = divmod(N,K) divmod(N,K) mod q , mod =divmod(q,K) divmod(q,K) q
#https://atcoder.jp/contests/abc156/tasks/abc156_b
N,K = map(int,input().split())
q, mod = divmod(N,K)
mod_list = [mod]
while True:
    q , mod =divmod(q,K)
    mod_list.append(mod)
    if q <=0 :
        break

n_ary = int("".join(map(str,mod_list[::-1])))
print(len(str(n_ary)))