N = int(eval(input()))

ans = float("inf")

c = 1

while c <= int(N**(1/2)//1):

  if N%c == 0:

    ans = min(ans,max(len(str(c)),len(str(N//c))))

  c += 1  

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

ans = float("inf")

for i in range(1,int(N**(1/2)//1)+1):

  if N%i == 0:

    ans = min(ans,len(str(N//i)))

print(ans)
N = int(eval(input()))
ans = float("inf")
c = 1
while c <= int(N ** (1 / 2) // 1):
    if N % c == 0:
        ans = min(ans, max(len(str(c)), len(str(N // c))))
    c += 1
print(ans)

N = int(eval(input()))
ans = float("inf")
for i in range(1, int(N ** (1 / 2) // 1) + 1):
    if N % i == 0:
        ans = min(ans, len(str(N // i)))
print(ans)

-c = 1 -while c <= int(N ** (1 / 2) // 1): -    if N % c == 0: -        ans = min(ans, max(len(str(c)), len(str(N // c)))) -    c += 1 +for i in range(1, int(N ** (1 / 2) // 1) + 1): +    if N % i == 0: +        ans = min(ans, len(str(N // i)))