def F(x,y):

    return max(len(str(x)),len(str(y)))

N = int(eval(input()))

dmin = 100

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

    if N%i==0:

        n = N//i

        dmin = min(dmin,F(i,n))

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

cmin = 1000

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

    if N%i==0:

        a = str(i)

        b = str(N//i)

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

print(cmin)
def F(x, y):
    return max(len(str(x)), len(str(y)))


N = int(eval(input()))
dmin = 100
for i in range(1, int(N**0.5) + 1):
    if N % i == 0:
        n = N // i
        dmin = min(dmin, F(i, n))
print(dmin)

N = int(eval(input()))
cmin = 1000
for i in range(1, int(N**0.5) + 1):
    if N % i == 0:
        a = str(i)
        b = str(N // i)
        cmin = min(cmin, max(len(a), len(b)))
print(cmin)

-def F(x, y): -    return max(len(str(x)), len(str(y))) - - -dmin = 100 +cmin = 1000 -        n = N // i -        dmin = min(dmin, F(i, n)) -print(dmin) +        a = str(i) +        b = str(N // i) +        cmin = min(cmin, max(len(a), len(b))) +print(cmin)