import math

n = int(eval(input()))

ans = float('inf')

i = 1

while i <= math.sqrt(n):

    if n % i == 0:

        a = int(len(str(i)))

        b = int(len(str(n // i)))

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

    i += 1

print(ans)
n = int(eval(input()))



i = 1

ans = 0

while i * i <= n:

    if n % i == 0:

        ans = max(len(str(i)), len(str(n // i)))

    i += 1

print(ans)
import math

n = int(eval(input()))
ans = float("inf")
i = 1
while i <= math.sqrt(n):
    if n % i == 0:
        a = int(len(str(i)))
        b = int(len(str(n // i)))
        ans = min(ans, max(a, b))
    i += 1
print(ans)

n = int(eval(input()))
i = 1
ans = 0
while i * i <= n:
    if n % i == 0:
        ans = max(len(str(i)), len(str(n // i)))
    i += 1
print(ans)

-import math - -ans = float("inf") -while i <= math.sqrt(n): +ans = 0 +while i * i <= n: -        a = int(len(str(i))) -        b = int(len(str(n // i))) -        ans = min(ans, max(a, b)) +        ans = max(len(str(i)), len(str(n // i)))