n, k =map(int, input().split())


for i in range(100):
    if n//(k**i) == 0:
        if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break n, k =map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k for i in range(100):
    if n//(k**i) == 0:
        if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break i range(100) range 100 if n//(k**i) == 0:
        if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break n//(k**i) == 0 n//(k**i) n k**i k i 0 if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break n%(k**i)>=1 n%(k**i) n k**i k i 1 print(i) print i break print(i-1) print i-1 i 1 break k =map(int, input().split()) map(int, input().split()) k n, k =map(int, input().split()) map(int, input().split()) n
n, k =map(int, input().split())


for i in range(100):
    if n//(k**i) == 0:
        if n%(k**i)>=1:
            print(i)
            break
        else:
            print(i-1)
            break
