N = int(eval(input()))



def factor(n):

    factList = []

    i = 1

    while i * i <= n:

        if n % i == 0:

            factList.append(i)

            factList.append(n // i)

        i += 1



    factList.sort()

    return factList



fact = factor(N)



ans = float('inf')

for i in range(len(fact)):

    f = max(len(str(fact[i])), len(str(fact[-1 - i])))

    ans = min(ans, f)



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



# 約数の全列挙

def divisors(n):

    divisors = []

    R = int(n**(0.5)) + 1

    for i in range(1, R):

        if n % i == 0:

            divisors.append(i)

            if i != n // i:

                divisors.append(n // i)

    # divisors.sort(reverse=True)  # ソート

    return divisors



ans = len(str(N))

for a in divisors(N):

    b = N // a

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

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


def factor(n):
    factList = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            factList.append(i)
            factList.append(n // i)
        i += 1
    factList.sort()
    return factList


fact = factor(N)
ans = float("inf")
for i in range(len(fact)):
    f = max(len(str(fact[i])), len(str(fact[-1 - i])))
    ans = min(ans, f)
print(ans)

N = int(eval(input()))
# 約数の全列挙
def divisors(n):
    divisors = []
    R = int(n ** (0.5)) + 1
    for i in range(1, R):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    # divisors.sort(reverse=True)  # ソート
    return divisors


ans = len(str(N))
for a in divisors(N):
    b = N // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

+# 約数の全列挙 +def divisors(n): +    divisors = [] +    R = int(n ** (0.5)) + 1 +    for i in range(1, R): +        if n % i == 0: +            divisors.append(i) +            if i != n // i: +                divisors.append(n // i) +    # divisors.sort(reverse=True)  # ソート +    return divisors -def factor(n): -    factList = [] -    i = 1 -    while i * i <= n: -        if n % i == 0: -            factList.append(i) -            factList.append(n // i) -        i += 1 -    factList.sort() -    return factList - - -fact = factor(N) -ans = float("inf") -for i in range(len(fact)): -    f = max(len(str(fact[i])), len(str(fact[-1 - i]))) -    ans = min(ans, f) +ans = len(str(N)) +for a in divisors(N): +    b = N // a +    ans = min(ans, max(len(str(a)), len(str(b))))