n = int(eval(input()))

factors = []

while n%2 == 0:

    factors.append(2)

    n //=2



for f in range(3, int(n**0.5)+ 1, 2):

    while n%f == 0:

        factors.append(f)

        n //= f

if n != 1:

    factors.append(n)



nf = len(factors)



fab = 11

sset = set()

als = 2**nf

for i in range(als):

    if als^i in sset:

        continue

    sset.add(i)

    a = 1

    b = 1

    for j in range(nf):

        if (i>>j)&1:

            a *= factors[j]

        else:

            b *= factors[j]



    fab = min(fab, max(len(str(a)), len(str(b))))

print(fab)

n = int(eval(input()))



ans = 11

for a in range(1, int(n**0.5)+1):

    if n%a != 0:

        continue

    b = n//a

    ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)



n = int(eval(input()))
factors = []
while n % 2 == 0:
    factors.append(2)
    n //= 2
for f in range(3, int(n**0.5) + 1, 2):
    while n % f == 0:
        factors.append(f)
        n //= f
if n != 1:
    factors.append(n)
nf = len(factors)
fab = 11
sset = set()
als = 2**nf
for i in range(als):
    if als ^ i in sset:
        continue
    sset.add(i)
    a = 1
    b = 1
    for j in range(nf):
        if (i >> j) & 1:
            a *= factors[j]
        else:
            b *= factors[j]
    fab = min(fab, max(len(str(a)), len(str(b))))
print(fab)

n = int(eval(input()))
ans = 11
for a in range(1, int(n**0.5) + 1):
    if n % a != 0:
        continue
    b = n // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

-factors = [] -while n % 2 == 0: -    factors.append(2) -    n //= 2 -for f in range(3, int(n**0.5) + 1, 2): -    while n % f == 0: -        factors.append(f) -        n //= f -if n != 1: -    factors.append(n) -nf = len(factors) -fab = 11 -sset = set() -als = 2**nf -for i in range(als): -    if als ^ i in sset: +ans = 11 +for a in range(1, int(n**0.5) + 1): +    if n % a != 0: -    sset.add(i) -    a = 1 -    b = 1 -    for j in range(nf): -        if (i >> j) & 1: -            a *= factors[j] -        else: -            b *= factors[j] -    fab = min(fab, max(len(str(a)), len(str(b)))) -print(fab) +    b = n // a +    ans = min(ans, max(len(str(a)), len(str(b)))) +print(ans)