import math

n = int(eval(input()))

m = math.ceil(math.sqrt(n))



min_f = float('inf')



for i in range(1, m+1):

  x = n/i

  if x.is_integer():

    x = int(x)

    i = int(i)

    f = max(len(str(i)), len(str(x)))

    if min_f > f:

      min_f = f

print(min_f)

n = int(eval(input()))



def make_divisors(n):

    divisors = []

    for i in range(1, int(n**0.5)+1):

        if n % i == 0:

            divisors.append(i)

            if i != n // i:

                divisors.append(n//i)



    #divisors.sort(reverse=True)

    return divisors



d = make_divisors(n)

ans = 10**18

for a in d:

    b = n//a

    a = str(a)

    b = str(b)

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

print(ans)

import math

n = int(eval(input()))
m = math.ceil(math.sqrt(n))
min_f = float("inf")
for i in range(1, m + 1):
    x = n / i
    if x.is_integer():
        x = int(x)
        i = int(i)
        f = max(len(str(i)), len(str(x)))
        if min_f > f:
            min_f = f
print(min_f)

n = int(eval(input()))


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    # divisors.sort(reverse=True)
    return divisors


d = make_divisors(n)
ans = 10**18
for a in d:
    b = n // a
    a = str(a)
    b = str(b)
    ans = min(ans, max(len(a), len(b)))
print(ans)

-import math +n = int(eval(input())) -n = int(eval(input())) -m = math.ceil(math.sqrt(n)) -min_f = float("inf") -for i in range(1, m + 1): -    x = n / i -    if x.is_integer(): -        x = int(x) -        i = int(i) -        f = max(len(str(i)), len(str(x))) -        if min_f > f: -            min_f = f -print(min_f) + +def make_divisors(n): +    divisors = [] +    for i in range(1, int(n**0.5) + 1): +        if n % i == 0: +            divisors.append(i) +            if i != n // i: +                divisors.append(n // i) +    # divisors.sort(reverse=True) +    return divisors + + +d = make_divisors(n) +ans = 10**18 +for a in d: +    b = n // a +    a = str(a) +    b = str(b) +    ans = min(ans, max(len(a), len(b))) +print(ans)