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


def calc(n, k):
    r = ""
    while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
    return r[::-1]


print(len(calc(n, k))) n, k = map(int, input().split(" ")) n map(int, input().split(" ")) map int input().split(" ") ().split () input split " " k def calc(n, k):
    r = ""
    while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
    return r[::-1] calc r = "" r "" while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
     n > 0 n 0 n, remainder = divmod(n, k) n divmod(n, k) divmod n k remainder r += str(remainder) r str(remainder) str remainder return r[::-1] r[::-1] r ::-1 -1 n n k k print(len(calc(n, k))) print len(calc(n, k)) len calc(n, k) calc n k k = map(int, input().split(" ")) map(int, input().split(" ")) k n, k = map(int, input().split(" ")) map(int, input().split(" ")) n def calc(n, k):
    r = ""
    while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
    return r[::-1] def calc(n, k):
    r = ""
    while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
    return r[::-1] calc
n, k = map(int, input().split(" "))


def calc(n, k):
    r = ""
    while n > 0:
        n, remainder = divmod(n, k)
        r += str(remainder)
    return r[::-1]


print(len(calc(n, k)))