
def main():
    N, K = map(int, input().split())
    ans = base10to(N, K)
    print(len(ans))

def base10to(n, b):
    if (int(n/b)):
       return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

if __name__ == '__main__':
    main() def main():
    N, K = map(int, input().split())
    ans = base10to(N, K)
    print(len(ans)) main N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K ans = base10to(N, K) ans base10to(N, K) base10to N K print(len(ans)) print len(ans) len ans def base10to(n, b):
    if (int(n/b)):
       return base10to(int(n/b), b) + str(n%b)
    return str(n%b) base10to if (int(n/b)):
       return base10to(int(n/b), b) + str(n%b)
     int(n/b) int n/b n b return base10to(int(n/b), b) + str(n%b) base10to(int(n/b), b) + str(n%b) base10to(int(n/b), b) base10to int(n/b) int n/b n b b str(n%b) str n%b n b return str(n%b) str(n%b) str n%b n b n n b b if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, K = map(int, input().split())
    ans = base10to(N, K)
    print(len(ans)) def main():
    N, K = map(int, input().split())
    ans = base10to(N, K)
    print(len(ans)) main def base10to(n, b):
    if (int(n/b)):
       return base10to(int(n/b), b) + str(n%b)
    return str(n%b) def base10to(n, b):
    if (int(n/b)):
       return base10to(int(n/b), b) + str(n%b)
    return str(n%b) base10to

def main():
    N, K = map(int, input().split())
    ans = base10to(N, K)
    print(len(ans))

def base10to(n, b):
    if (int(n/b)):
       return base10to(int(n/b), b) + str(n%b)
    return str(n%b)

if __name__ == '__main__':
    main()
