# vim: fileencoding=utf-8


def main():
    n, k = map(int, input().split())
    ans = 0
    while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1


if __name__ == "__main__":
    main() def main():
    n, k = map(int, input().split())
    ans = 0
    while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1 main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k ans = 0 ans 0 while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1 True t = n - k ** ans t n - k ** ans n k ** ans k ans if t == 0:
            print(ans + 1)
            return
         t == 0 t 0 print(ans + 1) print ans + 1 ans 1 return if t < 0:
            print(ans)
            return
         t < 0 t 0 print(ans) print ans return ans += 1 ans 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, k = map(int, input().split())
    ans = 0
    while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1 def main():
    n, k = map(int, input().split())
    ans = 0
    while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1 main
# vim: fileencoding=utf-8


def main():
    n, k = map(int, input().split())
    ans = 0
    while True:
        t = n - k ** ans
        if t == 0:
            print(ans + 1)
            return
        if t < 0:
            print(ans)
            return
        ans += 1


if __name__ == "__main__":
    main()
