from math import sqrt



N = int(eval(input()))



n = int(sqrt(N)) + 10

def f(A, B):

    a = len(str(A))

    b = len(str(B))

    return max(a, b)





ans = 10 ** 10

for i in range(1, n):

    if (N//i) * i == N:

        ans = min(ans, f(i, N//i))



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



def make_divisors(n):

    import math

    divisors = []

    for i in range(1, int(math.sqrt(n)) + 1):

        if n % i == 0: #割り切れるとき

            divisors.append(i)

            if i != n//i:

                divisors.append(n//i)

    divisors.sort()

    return divisors



def F(A, B):

    return max(len(str(A)), len(str(B)))





lst = make_divisors(N)



ans = 10 ** 18

for a in lst:

    b = N // a

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



print (ans)









from math import sqrt

N = int(eval(input()))
n = int(sqrt(N)) + 10


def f(A, B):
    a = len(str(A))
    b = len(str(B))
    return max(a, b)


ans = 10**10
for i in range(1, n):
    if (N // i) * i == N:
        ans = min(ans, f(i, N // i))
print(ans)

N = int(eval(input()))


def make_divisors(n):
    import math

    divisors = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:  # 割り切れるとき
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    divisors.sort()
    return divisors


def F(A, B):
    return max(len(str(A)), len(str(B)))


lst = make_divisors(N)
ans = 10**18
for a in lst:
    b = N // a
    ans = min(ans, F(a, b))
print(ans)

-from math import sqrt - -n = int(sqrt(N)) + 10 -def f(A, B): -    a = len(str(A)) -    b = len(str(B)) -    return max(a, b) +def make_divisors(n): +    import math + +    divisors = [] +    for i in range(1, int(math.sqrt(n)) + 1): +        if n % i == 0:  # 割り切れるとき +            divisors.append(i) +            if i != n // i: +                divisors.append(n // i) +    divisors.sort() +    return divisors -ans = 10**10 -for i in range(1, n): -    if (N // i) * i == N: -        ans = min(ans, f(i, N // i)) +def F(A, B): +    return max(len(str(A)), len(str(B))) + + +lst = make_divisors(N) +ans = 10**18 +for a in lst: +    b = N // a +    ans = min(ans, F(a, b))