n = int(eval(input()))

l = []



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

    if n % a == 0:

        b = n // a

        f = max(len(str(a)), len(str(b)))

        l.append(f)



print((min(l)))
n = int(eval(input()))

l = []



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

    if n % a == 0:

        b = n // a

        l.append(max(len(str(a)), len(str(b))))



print((min(l)))
n = int(eval(input()))
l = []
for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        f = max(len(str(a)), len(str(b)))
        l.append(f)
print((min(l)))

n = int(eval(input()))
l = []
for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        l.append(max(len(str(a)), len(str(b))))
print((min(l)))

-        f = max(len(str(a)), len(str(b))) -        l.append(f) +        l.append(max(len(str(a)), len(str(b))))