import itertools



n = int(eval(input()))





def prime_decomposition(n):

    i = 2

    table = []

    while i * i <= n:

        while n % i == 0:

            n /= i

            table.append(i)

        i += 1

    if n > 1:

        table.append(n)

    return table





n_table = prime_decomposition(n)

if not n_table:

    n_table.append(1)

f = 9999

#print(n_table)



for i in range(len(n_table) + 1):

#    print("\n" + str(i))

    i_a = itertools.combinations(n_table, i)



    while True:

        try:

            a = 1

            for j in next(i_a):

#                print("i_a=" + str(j))

                a *= j

            b = int(n / a)

#            print("b=" + str(b))

            _f = (len(str(max(a, b))))

        except StopIteration:

            break



        if _f < f:

            f = _f



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

i = 1

ans = n



while i * i <= n:

    if n % i == 0:

        b = n // i

        f = len(str(max(ans, b)))

        ans = min(ans, f)



    i += 1



print(ans)

import itertools

n = int(eval(input()))


def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table


n_table = prime_decomposition(n)
if not n_table:
    n_table.append(1)
f = 9999
# print(n_table)
for i in range(len(n_table) + 1):
    #    print("\n" + str(i))
    i_a = itertools.combinations(n_table, i)
    while True:
        try:
            a = 1
            for j in next(i_a):
                #                print("i_a=" + str(j))
                a *= j
            b = int(n / a)
            #            print("b=" + str(b))
            _f = len(str(max(a, b)))
        except StopIteration:
            break
        if _f < f:
            f = _f
print(f)

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

-import itertools - - - -def prime_decomposition(n): -    i = 2 -    table = [] -    while i * i <= n: -        while n % i == 0: -            n /= i -            table.append(i) -        i += 1 -    if n > 1: -        table.append(n) -    return table - - -n_table = prime_decomposition(n) -if not n_table: -    n_table.append(1) -f = 9999 -# print(n_table) -for i in range(len(n_table) + 1): -    #    print("\n" + str(i)) -    i_a = itertools.combinations(n_table, i) -    while True: -        try: -            a = 1 -            for j in next(i_a): -                #                print("i_a=" + str(j)) -                a *= j -            b = int(n / a) -            #            print("b=" + str(b)) -            _f = len(str(max(a, b))) -        except StopIteration: -            break -        if _f < f: -            f = _f -print(f) +i = 1 +ans = n +while i * i <= n: +    if n % i == 0: +        b = n // i +        f = len(str(max(ans, b))) +        ans = min(ans, f) +    i += 1 +print(ans)