def m_c_d(x, y):

    if x == 0:

        return y

    elif y == 0:

        return x

    else:

        return m_c_d(y, x % y)





a = int(eval(input()))

b = 0

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

    b = max(m_c_d(a, i), b)

print((max(len(str(b)), len(str(a // b)))))



a = int(eval(input()))

b = 10 ** 10

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

    if a % i == 0:

        b = min(b, max(len(str(i)), len(str(a // i))))

print(b)

def m_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return m_c_d(y, x % y)


a = int(eval(input()))
b = 0
for i in range(int(a**0.5 + 1), 1, -1):
    b = max(m_c_d(a, i), b)
print((max(len(str(b)), len(str(a // b)))))

a = int(eval(input()))
b = 10**10
for i in range(1, int(a**0.5) + 1):
    if a % i == 0:
        b = min(b, max(len(str(i)), len(str(a // i))))
print(b)

-def m_c_d(x, y): -    if x == 0: -        return y -    elif y == 0: -        return x -    else: -        return m_c_d(y, x % y) - - -b = 0 -for i in range(int(a**0.5 + 1), 1, -1): -    b = max(m_c_d(a, i), b) -print((max(len(str(b)), len(str(a // b))))) +b = 10**10 +for i in range(1, int(a**0.5) + 1): +    if a % i == 0: +        b = min(b, max(len(str(i)), len(str(a // i)))) +print(b)