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

def abc(n,m):
    a,b = divmod(n,m)
    return a,b

count = 0 
a = 1
while a !=0 :
    a,b = abc(N,K)

    N = a
    count += 1
print(count)     N, K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K def abc(n,m):
    a,b = divmod(n,m)
    return a,b abc a,b = divmod(n,m) a divmod(n,m) divmod n m b return a,b return a,b a b n n m m count = 0 count 0 a = 1 a 1 while a !=0 :
    a,b = abc(N,K)

    N = a
    count += 1 a !=0 a 0 a,b = abc(N,K) a abc(N,K) abc N K b N = a N a count += 1 count 1 print(count) print count N = a a N a = 1 1 a count += 1 1 count N, K = map(int,input().split()) map(int,input().split()) N count = 0 0 count b = abc(N,K) abc(N,K) b a,b = abc(N,K) abc(N,K) a def abc(n,m):
    a,b = divmod(n,m)
    return a,b def abc(n,m):
    a,b = divmod(n,m)
    return a,b abc K = map(int,input().split()) map(int,input().split()) K
N, K = map(int,input().split())

def abc(n,m):
    a,b = divmod(n,m)
    return a,b

count = 0 
a = 1
while a !=0 :
    a,b = abc(N,K)

    N = a
    count += 1
print(count)    