from collections import defaultdict



n = int(eval(input()))

fact = defaultdict(int)

fact[1] = 1

f = 2

k = n

while f * f <= min(k * k, n):

    if k % f == 0:

        fact[f] += 1

        k //= f

    else:

        f += 1

if k > 1:

    fact[k] += 1





def digits(n):

    ret = 0

    while n > 0:

        ret += 1

        n //= 10

    return ret





def dfs(index, mul, fact):

    if index >= len(fact):

        return max(digits(mul), digits(n // mul))

    k, v = fact[index]

    ret = 10

    for i in range(v + 1):

        ret = min(ret, dfs(index + 1, mul * pow(k, i), fact))

    return ret





print((dfs(0, 1, list(fact.items()))))
n = int(eval(input()))

ans = 10

i = 1





def dig(n):

    ret = 0

    while n > 0:

        ret += 1

        n //= 10

    return ret





while i*i <= n:

    if n % i == 0:

        ans = min(ans, max(dig(i), dig(n//i)))

    i += 1



print(ans)
from collections import defaultdict

n = int(eval(input()))
fact = defaultdict(int)
fact[1] = 1
f = 2
k = n
while f * f <= min(k * k, n):
    if k % f == 0:
        fact[f] += 1
        k //= f
    else:
        f += 1
if k > 1:
    fact[k] += 1


def digits(n):
    ret = 0
    while n > 0:
        ret += 1
        n //= 10
    return ret


def dfs(index, mul, fact):
    if index >= len(fact):
        return max(digits(mul), digits(n // mul))
    k, v = fact[index]
    ret = 10
    for i in range(v + 1):
        ret = min(ret, dfs(index + 1, mul * pow(k, i), fact))
    return ret


print((dfs(0, 1, list(fact.items()))))

n = int(eval(input()))
ans = 10
i = 1


def dig(n):
    ret = 0
    while n > 0:
        ret += 1
        n //= 10
    return ret


while i * i <= n:
    if n % i == 0:
        ans = min(ans, max(dig(i), dig(n // i)))
    i += 1
print(ans)

-from collections import defaultdict - -fact = defaultdict(int) -fact[1] = 1 -f = 2 -k = n -while f * f <= min(k * k, n): -    if k % f == 0: -        fact[f] += 1 -        k //= f -    else: -        f += 1 -if k > 1: -    fact[k] += 1 +ans = 10 +i = 1 -def digits(n): +def dig(n): -def dfs(index, mul, fact): -    if index >= len(fact): -        return max(digits(mul), digits(n // mul)) -    k, v = fact[index] -    ret = 10 -    for i in range(v + 1): -        ret = min(ret, dfs(index + 1, mul * pow(k, i), fact)) -    return ret - - -print((dfs(0, 1, list(fact.items())))) +while i * i <= n: +    if n % i == 0: +        ans = min(ans, max(dig(i), dig(n // i))) +    i += 1 +print(ans)