# ABC057 C - Digits in Multiplication

from itertools import combinations

def factorize(n):

    retlist = []

    temp = n

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

        if temp%i==0:

            while temp%i==0:

                temp //= i

                retlist.append(i)

    if temp!=1:

        retlist.append(temp)



    if retlist==[]:

        retlist.append(n)



    return retlist



N = int(eval(input()))



ans = 10000000

L = []

L = factorize(N)

# print(L)



for i in range(1,len(L)+1):

    C = []

    C = list(combinations(L,i))

    # print(C)

    for c in C:

        a,b = 1,0

        for j in range(len(c)):

            a *= c[j]

        b = N//a

        a = str(a)

        b = str(b)

        # print('a:',a,'b:',b)

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



print(ans)

n=int(eval(input()))

ans=10**18

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

  if n%a==0:

    b=n//a

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

    ans=min(ans,t)

print(ans)



# ABC057 C - Digits in Multiplication
from itertools import combinations


def factorize(n):
    retlist = []
    temp = n
    for i in range(2, int(-(-(n**0.5) // 1)) + 1):
        if temp % i == 0:
            while temp % i == 0:
                temp //= i
                retlist.append(i)
    if temp != 1:
        retlist.append(temp)
    if retlist == []:
        retlist.append(n)
    return retlist


N = int(eval(input()))
ans = 10000000
L = []
L = factorize(N)
# print(L)
for i in range(1, len(L) + 1):
    C = []
    C = list(combinations(L, i))
    # print(C)
    for c in C:
        a, b = 1, 0
        for j in range(len(c)):
            a *= c[j]
        b = N // a
        a = str(a)
        b = str(b)
        # print('a:',a,'b:',b)
        ans = min(ans, max(len(a), len(b)))
print(ans)

n = int(eval(input()))
ans = 10**18
for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        t = max(len(str(a)), len(str(b)))
        ans = min(ans, t)
print(ans)

-# ABC057 C - Digits in Multiplication -from itertools import combinations - - -def factorize(n): -    retlist = [] -    temp = n -    for i in range(2, int(-(-(n**0.5) // 1)) + 1): -        if temp % i == 0: -            while temp % i == 0: -                temp //= i -                retlist.append(i) -    if temp != 1: -        retlist.append(temp) -    if retlist == []: -        retlist.append(n) -    return retlist - - -N = int(eval(input())) -ans = 10000000 -L = [] -L = factorize(N) -# print(L) -for i in range(1, len(L) + 1): -    C = [] -    C = list(combinations(L, i)) -    # print(C) -    for c in C: -        a, b = 1, 0 -        for j in range(len(c)): -            a *= c[j] -        b = N // a -        a = str(a) -        b = str(b) -        # print('a:',a,'b:',b) -        ans = min(ans, max(len(a), len(b))) +n = int(eval(input())) +ans = 10**18 +for a in range(1, int(n**0.5) + 1): +    if n % a == 0: +        b = n // a +        t = max(len(str(a)), len(str(b))) +        ans = min(ans, t)