def make_divisors(n):

    divisors = []

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

        if n % i == 0:

            divisors.append(i)

            divisors.append(n//i)

    return divisors



N = int(eval(input()))

divisors = make_divisors(N)

ans = 12

for i in range(0, len(divisors), 2):

    a, b = divisors[i], divisors[i+1]

    m, n = 0, 0

    for x in range(1, 12):

        if a < 10 ** x:

            m = x

            break

    for x in range(1, 12):

        if b < 10 ** x:

            n = x

            break

    ans = min(ans, max(m, n))

print(ans)
import sys

input = sys.stdin.readline

import math



def make_divisors(n):

    divisors = []

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

        if n % i == 0:

            divisors.append(i)

            divisors.append(n//i)

    return divisors



N = int(eval(input()))

divisors = make_divisors(N)

ans = 11

for i in range(0, len(divisors), 2):

    d1 = int(math.log10(divisors[i]))+1

    d2 = int(math.log10(divisors[i+1]))+1

    ans = min(ans, max(d1, d2))

print(ans)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            divisors.append(n // i)
    return divisors


N = int(eval(input()))
divisors = make_divisors(N)
ans = 12
for i in range(0, len(divisors), 2):
    a, b = divisors[i], divisors[i + 1]
    m, n = 0, 0
    for x in range(1, 12):
        if a < 10**x:
            m = x
            break
    for x in range(1, 12):
        if b < 10**x:
            n = x
            break
    ans = min(ans, max(m, n))
print(ans)

import sys

input = sys.stdin.readline
import math


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


N = int(eval(input()))
divisors = make_divisors(N)
ans = 11
for i in range(0, len(divisors), 2):
    d1 = int(math.log10(divisors[i])) + 1
    d2 = int(math.log10(divisors[i + 1])) + 1
    ans = min(ans, max(d1, d2))
print(ans)

+import sys + +input = sys.stdin.readline +import math + + -ans = 12 +ans = 11 -    a, b = divisors[i], divisors[i + 1] -    m, n = 0, 0 -    for x in range(1, 12): -        if a < 10**x: -            m = x -            break -    for x in range(1, 12): -        if b < 10**x: -            n = x -            break -    ans = min(ans, max(m, n)) +    d1 = int(math.log10(divisors[i])) + 1 +    d2 = int(math.log10(divisors[i + 1])) + 1 +    ans = min(ans, max(d1, d2))