#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)
    #print(q)
    #print(mod)
    if q <=0 :
        break
if mod_list[-1] == 0:
    result = len(mod_list) - 1
else:
    result =len(mod_list)
print(result) 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)
    #print(q)
    #print(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 if mod_list[-1] == 0:
    result = len(mod_list) - 1
else:
    result =len(mod_list) mod_list[-1] == 0 mod_list[-1] mod_list -1 0 result = len(mod_list) - 1 result len(mod_list) - 1 len(mod_list) len mod_list 1 result =len(mod_list) result len(mod_list) len mod_list print(result) print result q, mod = divmod(N,K) divmod(N,K) q mod_list = [mod] [mod] mod_list N,K = map(int,input().split()) map(int,input().split()) N K = map(int,input().split()) map(int,input().split()) K mod =divmod(q,K) divmod(q,K) mod result =len(mod_list) len(mod_list) result result = len(mod_list) - 1 len(mod_list) - 1 result 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)
    #print(q)
    #print(mod)
    if q <=0 :
        break
if mod_list[-1] == 0:
    result = len(mod_list) - 1
else:
    result =len(mod_list)
print(result)