import math

N = int(eval(input()))

INF = float("inf")

for a in range(1, int(math.sqrt(N)) + 1):

    if N % a != 0:

        continue

    b = int(N / a)

    a = list(map(int, str(a)))

    b = list(map(int, str(b)))

    length = max(len(a), len(b))

    if INF > length:

        INF = length

print(INF)

N = int(eval(input()))



ans = float("inf")

for a in range(1, N+1):

    if a * a > N: break

    if N % a ==0:

        b = N / a

        f = max(a, b)

        keta = 0

        while True:

            keta += 1

            if 10 ** keta > f:

                break

        ans = min(ans, keta)

print(ans)

import math

N = int(eval(input()))
INF = float("inf")
for a in range(1, int(math.sqrt(N)) + 1):
    if N % a != 0:
        continue
    b = int(N / a)
    a = list(map(int, str(a)))
    b = list(map(int, str(b)))
    length = max(len(a), len(b))
    if INF > length:
        INF = length
print(INF)

N = int(eval(input()))
ans = float("inf")
for a in range(1, N + 1):
    if a * a > N:
        break
    if N % a == 0:
        b = N / a
        f = max(a, b)
        keta = 0
        while True:
            keta += 1
            if 10**keta > f:
                break
        ans = min(ans, keta)
print(ans)

-import math - -INF = float("inf") -for a in range(1, int(math.sqrt(N)) + 1): -    if N % a != 0: -        continue -    b = int(N / a) -    a = list(map(int, str(a))) -    b = list(map(int, str(b))) -    length = max(len(a), len(b)) -    if INF > length: -        INF = length -print(INF) +ans = float("inf") +for a in range(1, N + 1): +    if a * a > N: +        break +    if N % a == 0: +        b = N / a +        f = max(a, b) +        keta = 0 +        while True: +            keta += 1 +            if 10**keta > f: +                break +        ans = min(ans, keta) +print(ans)