You are given an integer N.

For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.

For example, F(3,11) = 2 since 3 has one digit and 11 has two digits.

Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B.

-----Constraints-----
 - 1 \leq N \leq 10^{10}
 - N is an integer.

-----Input-----
The input is given from Standard Input in the following format:
N

-----Output-----
Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B.

-----Sample Input-----
10000

-----Sample Output-----
3

F(A,B) has a minimum value of 3 at (A,B)=(100,100).

Difficulty: introductory

Starter code:

Solutions:
import math

N = int(input())

def f(a,b):
    if len(str(a)) < len(str(b)):
        return len(str(b))
    else:
        return len(str(a))

ans = 100000000000
for i in range(1,int(math.sqrt(N)+1)):
    if N % i == 0:
        ans = min(ans,f(i,N//i))
print(ans)


# C - Digits in Multiplication
def main():
    n = int(input())
    ans = []

    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans.append(max(len(str(i)), len(str(n//i))))
    else:
        print(min(ans))



        
def __starting_point():
    main()
__starting_point()

import math
n = int(input())
ans = 10
for i in range(1, int(math.sqrt(n))+1):
  if n%i == 0:
    ans2 = max(len(str(i)), len(str(n//i)))
    #print(i,len(str(i)), len(str(n//i)))
    if ans > ans2:
      ans = ans2
print(ans)


n = int(input())
i = 1
ans = float("inf")
while i**2 <= n:
    if n%i == 0:
        ans = min(ans, max(len(str(i)), len(str(n//i))))
    i += 1
print(ans)

import math
n = int(input())
ans = len(str(n))
for i in range(1,int(math.sqrt(n))+1):
    if n%i == 0:
        ans = min(ans,max(len(str(i)),len(str(n//i))))
print(ans)

import math

N = int(input())
A = []
B = []
num_list = []

root = math.floor(math.sqrt(N))


def solv(N):
    for i in range(1,root+1):
        if N%i == 0:
            A.append(i)
            B.append(N//i)
    for a,b in zip(A,B):
        a_str = str(a)
        b_str = str(b)
        a_num = len(a_str)
        b_num = len(b_str)
        if a_num > b_num:
            num_list.append(a_num)
        elif a_num < b_num:
            num_list.append(b_num)
        else:
            num_list.append(a_num)
    return print(min(num_list))

solv(N)


from math import sqrt, log10
n = int(input())

for i in reversed(range(int(sqrt(n))+1)):
    if n%i==0:
        break
a = int(log10(i))+1
b = int(log10(n//i))+1
print(max(a,b))

n = int(input())

val = 0
ans = float('inf')
for i in range(1, int(n**0.5+1)):
  if n % i == 0:
    val = max(len(str(i)), len(str(int(n/i))))
    ans = min(ans, val)
print(ans)

N = int(input())
keta = len(str(10 **10))
for i in range(1, int(10**5)+1):
    if N%i == 0:
        keta = min(keta, max(len(str(i)), len(str(N//i))))
print(keta)



import math
n=int(input())
ans=100
for a in range(1,int(math.sqrt(n))+1):
    if n%a==0:
        m=max(len(str(a)),len(str(n//a)))
        ans=min(ans,m)
print(ans)

import math
n=int(input())
ans=10
for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
        b=int(n/i)
        f=max(len(str(i)),len(str(b)))
        ans=min(f,ans)
print(ans)

n = int(input())
for i in range(int(n**0.5), 0, -1):
  if n % i == 0:
    print(len(str(n//i)))
    break

n=int(input())

def f(a,b):
    a,b=len(str(a)),len(str(b))
    return max(a,b)

flist=[]
a=int(n**0.5)

for i in range(1,a+1):
    if n%i==0:
        j=int(n/i)
        tmp=f(i,j)
        flist.append(tmp)
print(min(flist))

N = int(input())
ans = 100000
for i in range(1, 10 ** 5):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


import sys
import math


def f(x: int, y: int) -> int:
    return max(len(str(x)), len(str(y)))


n = int(input())
min_f_value = sys.maxsize

for a in range(1, int(math.sqrt(n)) + 1):
    b, rem = divmod(n, a)
    if rem == 0:
        min_f_value = min(min_f_value, f(a, b))

print(min_f_value)


N = int(input())
ans = 100000
for i in range(1, 10 ** 7):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


n = int(input())
ans = float("inf")

for i in range(1,int(n**0.5)+2):
    if n % i == 0:
        j = n // i
        
        res = max(len(str(i)),len(str(j)))
        ans = min(ans,res)
        
print(ans)

N=int(input())

def divisors(N):
    result = 1e12
    for i in range(2, N):
        if i**2>N:
            break
        if N%i==0:
            B=int(N/i)
            tmp = max(len(str(B)), len(str(i)))
            result = min(result, tmp)
    # 自身でしか割れない
    if result==1e12:
        result = len(str(N))
    return result

print((divisors(N)))


from math import sqrt
n = int(input())
res = 100
for a in range(1, int(sqrt(n)) + 1):
  if n % a == 0:
    b = n // a
    res = min(res, max(len(str(a)), len(str(b))))
print(res)

import math
n = int(input())

def k(p):
  c = 0
  while p > 0:
    c += 1
    p //= 10
  return c

res = 100
for i in range(1,int(math.sqrt(n)) + 5):
  if n % i == 0:
    res = min( max(k(i), k(n//i)), res)

print(res)

n = int(input())
for i in range(int(n**0.5), 0, -1):
  if n % i == 0:
    print(len(str(n//i)))
    break

N=int(input())

ans=len(str(N))
for A in range(1,int(-(-N**0.5//1))+1):
    if N%A!=0:
        continue

    B=N//A
    ans=min(ans,max(len(str(A)),len(str(B))))

print(ans)

N = int(input())
high_divs = []
k = 1

while k*k <= N:
  if N%k == 0:
    high_divs.insert(0,N//k)
  k += 1

print(len(str(high_divs[0])))

n = int(input())

x = int(n ** 0.5)

for i in range(x):
    if n % (x - i) == 0:
        print(len(str(n // (x - i))))
        break

def __starting_point():
    N = int(input())
    i = 1
    ans = 10
    while i*i <= N:
        if N%i == 0:
            f = max(len(str(i)), len(str(N//i)))
            ans = min(f, ans)
        i += 1
    
    print(ans)

__starting_point()

# ABC 057: C – Digits in Multiplication
N = int(input())

Fs = [len(str(N))]

for n in range(2, int(N ** (1 / 2)) + 1):
    if N % n == 0:
        num_digit = len(str(n)) if len(str(n)) >= len(str(N // n)) else len(str(N // n))
        Fs.append(num_digit)

print(min(Fs))

n=int(input())
import math
r=math.sqrt(n)
ans=len(str(n))
for i in range(1, math.floor(r)+1):
    if n%i==0:
        ans=min(ans, max(len(str(i)), len(str(n//i))))
print(ans)

n = int(input())
div = [1, ]
for i in range(2, int(n ** 0.5) + 1):
    if n % i == 0:
        div.append(i)
m = div[-1]
if m == 1:
    print((len(str(n))))
else:
    print((max(len(str(n//m)), len(str(m)))))


n = int(input())
l = []
i = 1
while i * i <= n:
    if n % i == 0:
        num = max(len(str(i)), len(str(n // i)))
        l.append(num)
    i += 1
print(min(l))

N=int(input())
i=1
ans=1000000000000
while i*i<=N:
    if N%i==0:
        x=i
        y=N//i
        ans=min(ans,max(len(str(x)),len(str(y))))
    i+=1
print(ans)


def get_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            upper_divisors.append(n//i)
        i += 1
    return [lower_divisors, upper_divisors]

n = int(input())

up = get_divisors(n)[0]
dn = get_divisors(n)[1]

ans = 11
for a, b in zip(up, dn):
    a = str(a)
    b = str(b)
    f = max(len(a), len(b))
    ans = min(ans, f)

print(ans)

def func(n) :
    i = 1
    b = n
    while i*i <= n :
        if n % i == 0 :
            if max(len(str(i)), len(str(n//i))) < b :
                b = max(len(str(i)), len(str(n//i)))
        
        
        i += 1
    
    return print(b)        

n = int(input())
func(n)

from math import sqrt

n = int(input())
ans = float("INF")
for i in range(1,int(sqrt(n))+1):
    if n%i == 0:
        j = n//i
        ans = min(ans,max(len(str(i)),len(str(j))))
print(ans)


N = int(input())

M = 1

for i in range(1, int(N ** (1/2)) + 1):
   if N % i == 0:
      if M < i:
         M = i

M = N // M

ndm = len(list(str(M)))

print(ndm)

N = int(input())

A = 1
ans = len(str(N))
while A**2 <= N:
    if N % A == 0:
        B = int(N / A)
        num = max(len(str(A)), len(str(B)))
        ans = min(ans, num)
    A += 1
print(ans)

N = int(input())
M = int(pow(N,1/2))

for i in range(M,0,-1):
    if N%i == 0:
        print((len(str(N//i))))
        return


import math
n = int(input())

for a in range(1, int(math.sqrt(n))+1):
    if n%a == 0:
        b = n//a
        ans = len(str(b))
print(ans)

import sys

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors  + upper_divisors[::-1]


input = sys.stdin.readline

n = int(input())

yaku_list = make_divisors(n)
length = len(yaku_list)
half_index = int(length/2)

a = 0
b = 0
if length % 2 == 0:
    a = yaku_list[half_index]
    b = yaku_list[half_index-1]
else:
    a = yaku_list[half_index]
    b = a

keta_a = len(str(a))
keta_b = len(str(b))

print(max(keta_a,keta_b))

n = int(input())

def cal(a):
  return len(str(a))
m = 11
for i in range(1,6):
  for j in range(1,10**i+1):
    if n%j==0:
      m = min(m,max(cal(j),cal(n//j)))
      # print(m)
print(m)

n=int(input())

for i in range(int(n**0.5),0,-1):
    if n%i==0:
        break

print((len(str(n//i))))


n = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

yakusu = make_divisors(n)
l_yakusu = len(yakusu)
idx = 0

mx = 10

for a in range(1,10**5+1):
    if a>n:
        break
    if idx<l_yakusu and a==yakusu[idx]:
        idx += 1
        keta_a = len(str(a))
        keta_b = len(str(n//a))
        f = max(keta_a, keta_b)
        mx = min(mx, f)

print(mx)

from math import sqrt
from math import floor
n = int(input())
ans = 10 ** 10
for i in range(1,floor(sqrt(n))+1):
    if n % i == 0:
        a = str(i)
        b = str(n // i)
        ans = min(ans,max(len(a),len(b)))
print(ans)

N=int(input())

i=1
lst=[]
while i*i<=N:
	if N%i==0:
		lst.append(max(i,N//i))
	i+=1

ans=min(lst)
print(len(str(ans)))

n = int(input())

def divs(n:int) -> list:
    divs = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divs.append(i)
            if i != n // i:
                divs.append(n//i)
    divs.sort()
    return divs

div_l = divs(n)
print((max(len(str(div_l[(len(div_l)//2)-1])), len(str(div_l[len(div_l)//2])))))


from math import sqrt

n = int(input())
ans = float('inf')
for a in range(1, int(sqrt(n)) + 1):
    if n % a == 0:
        b = n // a
        ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

n = int(input())
a = 1
for i in range(1, int(n ** 0.5)+1):
  if n % i == 0:
    a = i
#print(a, n // a)
print(max(len(str(a)), len(str(n // a))))

def digit(a,b):
    a = str(a)
    b = str(b)
    return max(len(a),len(b))

def makedivisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n//i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
l = makedivisors(n)
m = 10**9
for a in range(len(l)):
    for b in range(len(l)):
        if l[a] * l[b] == n:
            m = min(m,digit(l[a],l[b]))
print(m)
    


n=int(input())

root=int(n**0.5)

min_keta=10000000000
for i in range(1,root+1):
    if n%i==0:
        one=len(str(i))
        two=len(str(n//i))
        min_keta=min(min_keta,max(one,two))




print(min_keta)


#n, *d = map(int, open(0).read().split())
# dream dreamer erase eraser 
n=int(input())

def f(a,b):
    return max(len(str(a)),len(str(b)))
m=10000
for a in range(1,10**10):
    if n%a==0:
        m=min(f(a,n//a),m)
    if n<a or n//a<a:
        break
print(m)

import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def make_divisors(n: int):
    lower_divs = []
    upper_divs = []
    i = 1
    while i**2 <= n:
        if n % i == 0:
            lower_divs.append(i)
            if i != n // i:
                upper_divs.append(n // i)
        i += 1
    return lower_divs + upper_divs[::-1]


def main():
    n = input_int()
    divs = make_divisors(n)
    ans = float("inf")
    for div in divs:
        a = div
        b = n // div
        if a * a <= n:
            ans = min(ans, max(len(str(a)), len(str(b))))
    print(ans)
    return


def __starting_point():
    main()

__starting_point()

N = int(input())
ans = 100000
for i in range(1, 13 * 10 ** 6):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


n = int(input())
def f(a,b):
    a = list(str(a))
    b = list(str(b))
    return max(len(a),len(b))

m = float('inf')
for i in range(1,int(n**0.5)+1):
    if n%i == 0:
        m = min(m,f(i,n//i))
print(m)


n = int(input())

def cal(a):
  return len(str(a))
m = 11
for j in range(1,10**6+1):
  if n%j==0:
    m = min(m,max(cal(j),cal(n//j)))
    # print(m)
print(m)

n=int(input())
x=int(n**0.5)
for i in range(x):
    if n%(x-i)==0:
        print(len(str(n//(x-i))))
        break

# coding: utf-8
import math
import copy
import itertools
n = int(input())
flg=False
for i in range(int(math.sqrt(n))+1, 0,-1):
    #print(i)
    if n%i==0:
        a=i
        b=n//a
        flg=True
        break
if flg:
    print(max(len(str(a)), len(str(b))))
else:
    print(len(str(n)))


url = "https://atcoder.jp//contests/abc057/tasks/abc057_c"
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def main():
    n = int(input())
    ans = 10000000000000000
    ns = make_divisors(n)
    for i in range(0, (len(ns)//2) + 1):
        tmp = max(len(str(ns[i])), len(str(ns[len(ns)-i-1])))
        ans = tmp if tmp < ans else ans
    if len(ns) % 2 != 0:
            tmp = len(str(ns[len(ns) // 2]))
            ans = tmp if tmp < ans else ans
    print(ans)

def __starting_point():
    main()

__starting_point()

import math
N=int(input())
root_N=int(math.sqrt(N))
for i in range(root_N,0,-1):
  if N%i==0:
    print(len(str(N//i)))
    break

N = int(input())
ans = 100000
for i in range(1, 17 * 10 ** 6):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


n=int(input())
i=1
a=[]
while i**2<=n:
    if n%i==0:
        b=[str(i),str(n//i)]
        a.append(b)
    i+=1
print(len(a[-1][1]))

def divisor(n):
    i = 1
    f = 0
    table = []
    while i * i <= n:
        if n % i == 0:
            f = max(len(str(i)), len(str(n//i)))
            table.append(f)
        i += 1
    return table


n = int(input())
print((min(divisor(n))))


import math

n = input()
answer =  len(n)
number = int(n)
for a in range(int(math.sqrt(int(n))),1,-1):
  if number%a != 0:
    continue
  b = number//a
  answer = min(answer, max(len(str(a)),len(str(b))))
  break
  
print(answer)

import math
n = int(input())
s = math.ceil(math.sqrt(n))
h = 10**5
for i in range(1,s+1):
  if n%i==0:
    if h > max(len(str(i)),len(str(int(n/i)))):
      h = max(len(str(i)),len(str(int(n/i))))
print(h)

N = int(input())
minimum = 10**10
for i in range(1,int(N**.5)+1):
    if N%i == 0:
        minimum = min(minimum, max(len(str(i)), len(str(N//i))))
print(minimum)


n = int(input())
def solve(n):
    i = 1
    ans = 10000000
    while i*i <= n:
        if n % i == 0:
            lower = i
            if i != n // i:
                upper = n//i
            else:
                upper = i
            anstmp = max(len(str(lower)), len(str(upper)))
            if ans > anstmp:
                ans = anstmp
        i += 1
        
    return ans

print(solve(n))

def digit(a,b):
    a = str(a)
    b = str(b)
    return max(len(a),len(b))

def makedivisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n//i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
l = makedivisors(n)
m = 10**9
for a in range(len(l)):
    for b in range(a,len(l)):
        if l[a] * l[b] == n:
            m = min(m,digit(l[a],l[b]))
print(m)
    


import math
N = int(input())

L = []
for i in range(1, math.floor(N ** 0.5) + 1):
    if N % i == 0:
        L.append([i, N // i])

ans = float('inf')
for i in range(len(L)):
    if L[i][0] > L[i][1]:
        ans = min(ans, len(str(L[i][0])))
    else:
        ans = min(ans, len(str(L[i][1])))

print(ans)


N = int(input())
ans = 100000
for i in range(1, 15 * 10 ** 6):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)


def solve(num):
    s_num = str(num)
    return len(s_num)

n = int(input())
res = []
for i in range(1, int(n**.5)+1):
    if n%i == 0:
        x = n//i
        res.append(max(solve(x), solve(i)))
print(min(res))

N = int(input())
f = lambda x,y:len(str(x)) if x > y else len(str(y))
from math import floor, sqrt
ans = len(str(N))
for a in range(1,floor(sqrt(N))+1):
    if N % a == 0:
        ans = min(ans, f(a,N//a))
print(ans)

N=int(input())

def divisor(n):
	i=1
	table=[]
	while i*i<=n:
		if n%i==0:
			table.append(n//i)
		i+=1
	num=min(table)
	ans=len(str(num))
	return ans
  
print(divisor(N))

n = int(input())

def cal(a):
  return len(str(a))
m = 11
for j in range(1,10**5+1):
  if n%j==0:
    m = min(m,max(cal(j),cal(n//j)))
    # print(m)
print(m)

import math
N = int(input())
lim = math.floor(math.sqrt(N))
f_min = len(str(N))
for i in range(1, lim + 1):
  if N % i == 0:
    B = int(N / i)
    if len(str(B)) < f_min:
      f_min = len(str(B))
print(f_min)


n=int(input())
x=int(n**0.5)
for i in range(x):
  if n%(x-i)==0:
    y=n//(x-i)
    y=str(y)
    print(len(y))
    break

import math

n = int(input())

def f(a, b):
  if len(str(a)) < len(str(b)):
    return len(str(b))
  else:
    return len(str(a))

ans = float('inf')
for i in range(1, int(math.sqrt(n)+1)):
  if n%i == 0:
    ans = min(ans, f(i, n//i))
print(ans)

n = int(input())

def decomp(n):
    ans = float('inf')

    for i in range(1, int(-(-n**0.5//1))+1):
        if n%i == 0:
            ans = min(ans, max(len(str(i)), len(str(n//i))))
    print(ans)

decomp(n)

n = int(input())
ans = []
    
for i in range(1,int(n**0.5) + 1):
  if (n/i).is_integer():
    a = len(str(i))
    b = len(str(int(n/i)))
    x = max(a,b)
    ans.append(x)
    

print(min(ans))

n = int(input())
res = 11
for a in range(1, int(n ** 0.5) + 1):
    if n % a == 0:
        b = n // a
        f = max(len(str(a)), len(str(b)))
        res = min(f, res)

print(res)


N=int(input())
res=N
for i in range(1,int(N**(1/2))+1) :
  if N%i==0 :
    res=min(res,N//i)
print(len(str(res)))


N = int(input())
F = [100000000000, 1]

for a in range(1, int(N ** 0.5) + 1):
    if N % a == 0:
        b = int(N / a)
        f = [a, b]
        if max(len(str(f[0])), len(str(f[1]))) < max(len(str(F[0])), len(str(F[1]))):
            F = f

print(max(len(str(F[0])), len(str(F[1]))))

import math
n = int(input())
a = 0
for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0:
        a = i
b = n//a
j = 0
while True:
    m = b / (10**j)
    if m>=1 and m<10:
        ans = j+1
        break
    j+=1

print(ans)


from math import *

def func(x):
  ret_val=0
  while 0<x:
    x//=10
    ret_val+=1
  return ret_val

N=int(input())
ans=func(N)
for A in range(1,int(sqrt(N))+1):
  if N%A==0:
    B=N//A
    temp=max(func(A),func(B));
    ans=min(ans,temp)
print(ans)


# -*- coding: utf-8 -*-
"""
Created on Wed Oct  7 11:29:47 2020

@author: liang
"""

import math

N = int(input())
R = int(math.sqrt(N))
for i in range(R,0,-1):
    if N%i == 0:
        print(len(str(N//i)))
        break

# Problem: https://atcoder.jp/contests/abc057/tasks/abc057_c
# Python 1st Try

import sys
# from collections import defaultdict
# import heapq,copy
import pprint as pp
# from collections import deque
def II(): return int(sys.stdin.readline())
def MI(): return list(map(int, sys.stdin.readline().split()))
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


# Const
MAXSIZE = ( 1 << 31 ) -1
MINSIZE = -( 1 << 31) + 1


def solver(input_int):
    result = len(str(input_int))
    for j in range(1, int(input_int**0.5) +1 , +1):
        divide_check = (input_int % j) != 0
        if divide_check:
            continue
        divide_value = input_int // j
        long_check = len(str(divide_value)) <= result
        if long_check:
            result = len(str(divide_value))
    # algorithm
    return result


def __starting_point():
    N = II()
    print(("{}".format(solver(N))))

__starting_point()

import math
bb = int(input())
mini = bb
aa = int(math.sqrt(bb))
for i in range(1,aa+1):
  if bb%i == 0:
    cc = int(bb/i)
    
    ans = len(str(cc))
    if ans < mini:
      mini = ans
print(mini)

import math
n = int(input())
if n < 10:
    print(1)
else:
    a = 0
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            a = i
    b = n//a
    j = 1
    while True:
        m = b / (10**j)
        if m>=1 and m<10:
            ans = j+1
            break
        j+=1

    print(ans)

n = int(input())
def f(a,b):
    a = list(str(a))
    b = list(str(b))
    return max(len(a),len(b))

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

l = make_divisors(n)
if len(l)%2 == 0:
    m = float('inf')
    for i in range(len(l)//2):
        m = min(m, f(l[i],n//l[i]))
    print(m)
else:
    m = float('inf')
    for i in range(len(l)//2+1):
        m = min(m, f(l[i],n//l[i]))
    print(m)

# -*- coding: utf-8 -*-
import math

N = int(input())

ans = 10
for A in range(1, int(math.sqrt(N)+1)):
    if N % A == 0:
        B = int(N / A)
        tmp = max(len(str(A)), len(str(B)))
        if ans > tmp:
            ans = tmp

print(ans)


N = int(input())
A = 1
for i in range(2,int(N**(1/2))+1):
    if  N%i == 0:
        A = i
B = str(N//A)
A = str(A)
print(max(len(B),len(A)))

import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return list(map(int, input().split()))
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

import string

def main():
    N = i_input()

    l = []
    for i in range(1,math.ceil(sqrt(N))+1):
        if N % i == 0:
            l.append(i)

    ans = INF
    for i in l:
        b = N//i
        c = max(i,b)
        ans = min(ans, len(str(c)))
    print(ans)


def __starting_point():
    main()

__starting_point()

n = int(input())
ans = 0
for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        ans = max(0, n // i, i)

print((len(str(ans))))



def cal(N):
    num=(N**0.5)//1
    num=int(num)
    for i in range(num,0,-1):
       if N%i==0:
           k=int(N/i)
           x=len(str(k))
           break
    return x

print(cal(int(input())))

import math


def f(a, b: int) -> int:
    alen = len(str(a))
    blen = len(str(b))
    if alen > blen:
        return alen
    else:
        return blen


n = int(input())
max = int(math.sqrt(n))
fmin = len(str(n))

for i in range(1, max+1):
    if n % i == 0:
        tmp = f(i, int(n/i))
        if tmp < fmin:
            fmin = tmp
print(fmin)

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

n=int(input())
a=make_divisors(n)[-1]
b=n//a
print((len(str(b))))


num = int(input())

digits = len(str(num))

ans = digits

for i in range(1,10 ** (digits // 2 + 1)):
    if num % i == 0:
        target = max(len(str(i)), len(str(num//i)))
        if ans >= target:
            ans = target
        else:
            print(ans)
            return
print(ans)

import math


def main():
    N = int(input())

    # A < B として、探索する
    # A <= 10^5
    keta = int(math.log10(N))+1
    for A in range(1, int(pow(N, 0.5)) + 1):
        if N % A == 0:
            B = N // A
            # print(B, int(math.log10(B))+1)
            keta = min(keta, int(math.log10(B))+1)

    print(keta)


main()


def divisor(n):
    l = []
    ll = []
    for i in range(1, int(n**0.5)+1):
        if n%i == 0:
            l.append(i)
            # ll.append(n//i)
    # l += reversed(ll)
    # l = sorted(list(set(l)))
    return l


n = int(input())
l = divisor(n)
ans = 100100100100

for i in l:
    a = len(str(i))
    b = len(str(n//i))
    ans = min(ans, max(a, b))

print(ans)



N = int(input())


ans = N
for i in range(int(N ** 0.5) + 1, 1, -1):
    if N % i == 0:
        ans = N // i
        break
print((len(str(ans))))


import math
def ten(p):
    if p == 0:
        return 0
    else:
        return ten(p // 10) + 1
N = int(input())
x = int(math.sqrt(N))
while N % x != 0:
    x -= 1
y = int(N / x)

print((ten(y)))




import math
N=int(input())
sqN=math.floor(math.sqrt(N))
for i in range(sqN):
  if N%(i+1)==0:
    B=N//(i+1)
    B=str(B)
    B=list(map(str,B))
    F=len(B)
print(F)

n = int(input())
ans = 10 ** 9
for i in range(1, int(n**0.5) + 1):
  if n % i != 0:
    continue
  ans = min(ans, max(len(str(i)), len(str(n//i))))
print(ans)