from string import printable
def func1(x, b):
    assert(x >= 0)
    assert(1< b < 37)
    r = ''
    while x > 0:
        r = printable[x % b] + r
        x //= b
    return r
def func2(s, b):
    assert(1 < b < 37)
    return int(s, b)
def convert(s, a, b):
    return func1(func2(s, a), b)
n, k= map(int, input().split())
x=convert(str(n), 10, k)
print(len(x)) from string import printable def func1(x, b):
    assert(x >= 0)
    assert(1< b < 37)
    r = ''
    while x > 0:
        r = printable[x % b] + r
        x //= b
    return r func1 assert(x >= 0) x >= 0 x 0 assert(1< b < 37) 1< b < 37 1< b 1 b 37 r = '' r '' while x > 0:
        r = printable[x % b] + r
        x //= b
     x > 0 x 0 r = printable[x % b] + r r printable[x % b] + r printable[x % b] printable x % b x b r x //= b x b return r r x x b b def func2(s, b):
    assert(1 < b < 37)
    return int(s, b) func2 assert(1 < b < 37) 1 < b < 37 1 < b 1 b 37 return int(s, b) int(s, b) int s b s s b b def convert(s, a, b):
    return func1(func2(s, a), b) convert return func1(func2(s, a), b) func1(func2(s, a), b) func1 func2(s, a) func2 s a b s s a a b b n, k= map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k x=convert(str(n), 10, k) x convert(str(n), 10, k) convert str(n) str n 10 k print(len(x)) print len(x) len x def func2(s, b):
    assert(1 < b < 37)
    return int(s, b) def func2(s, b):
    assert(1 < b < 37)
    return int(s, b) func2 n, k= map(int, input().split()) map(int, input().split()) n k= map(int, input().split()) map(int, input().split()) k def convert(s, a, b):
    return func1(func2(s, a), b) def convert(s, a, b):
    return func1(func2(s, a), b) convert x=convert(str(n), 10, k) convert(str(n), 10, k) x def func1(x, b):
    assert(x >= 0)
    assert(1< b < 37)
    r = ''
    while x > 0:
        r = printable[x % b] + r
        x //= b
    return r def func1(x, b):
    assert(x >= 0)
    assert(1< b < 37)
    r = ''
    while x > 0:
        r = printable[x % b] + r
        x //= b
    return r func1
from string import printable
def func1(x, b):
    assert(x >= 0)
    assert(1< b < 37)
    r = ''
    while x > 0:
        r = printable[x % b] + r
        x //= b
    return r
def func2(s, b):
    assert(1 < b < 37)
    return int(s, b)
def convert(s, a, b):
    return func1(func2(s, a), b)
n, k= map(int, input().split())
x=convert(str(n), 10, k)
print(len(x))