Problem:
 Score : 300 points    Problem Statement 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 1 10000      Sample Output 1 3  F(A,B) has a minimum value of 3 at (A,B)=(100,100) .       Sample Input 2 1000003      Sample Output 2 7  There are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1) . For these pairs, F(1,1000003)=F(1000003,1)=7 .       Sample Input 3 9876543210      Sample Output 3 6

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

Solution (Python):
import math
N = int(input())
M = int(math.sqrt(N))
for i in range(M):
    K = M - i
    if N % K == 0:
        L = N // K
        break
c = 0
while L > 0:
    L //= 10
    c += 1
print(c)

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

Solution (Python):
N = int(input())
sqN = N**0.5


def F(a, b):
    count = 0
    for i in range(10):
        a = a // 10
        b = b // 10
        count += 1
        if a <= 0 and b <= 0:
            break
    return count


minF = 10
for i in range(1, int(sqN)+1):
    if N % i == 0:
        f = F(i, N / i)
        minF = min(minF, f)

print(minF)

Solution (Python):
import math

N = int(input())
M = int(N**0.5//1)
S = list()
for i in range(M+1):
    if i > 0 :
       if N%i == 0:
           S.append(i)
a =  S[-1]
b = N//a
print(max(len(str(a)),len(str(b))))

Solution (Python):
import math

N = int(input())

min_l = len(str(N))

for i in range(1, int(math.sqrt(N)) + 1):
    if N % i == 0:
        j = int(N / i)
        min_l = min(min_l, max(len(str(i)), len(str(j))))
print(min_l)

Solution (Python):
import math
N = int(input())
root = math.sqrt(N) // 1
temp = 1
a = 1
while temp <= root:
    if N % temp == 0:
        a = temp
    temp += 1
print(len(str(N // a)))

Solution (Python):


n = int(input())

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

    divisors.sort()
    return divisors

div = make_divisors(n)

ans = 10000000000

for i in range(len(div)):
    length = max(len(str(div[i])),len(str(int(n/div[i]))))
    ans = min(length,ans)

print(ans)

Solution (Python):
n=int(input())
ans=10
for i in range(1,10**5+1):
  if n%i==0 and n//i>=i:
    ans=min(ans,len(str(n//i)))
print(ans)

Solution (Python):
import math
N=int(input())

answer = 20

for a in range(1, math.floor(N**0.5+1)):
  if not N%a:
    answer = min(answer, math.floor(math.log10(N//a))+1)
print(answer)

Solution (Python):
N = int(input())
A = 1
answer = 10**10
while A**2 <= N:
    if N % A == 0:
        B = N//A
        if answer > max(len(str(A)), len(str(B))):
            answer = max(len(str(A)), len(str(B)))
    A += 1
print(answer)

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

Solution (Python):
from math import sqrt, ceil


def digit_num(n: int)->int:
    ret = 0
    while n > 0:
        ret += 1
        n //= 10
    return ret


def F(A: int, B: int)->int:
    return digit_num(max(A, B))


def digits_in_multiplication(N: int)->int:
    sq = ceil(sqrt(N))

    for n in range(sq, 0, -1):
        if N % n == 0:
            return F(N//n, n)
    return F(N, 1)


if __name__ == "__main__":
    N = int(input())
    ans = digits_in_multiplication(N)
    print(ans)

Solution (Python):
import math

N = int(input())

def keta(n):
    res = 1
    t = n // 10
    while t > 0:
        t //= 10
        res += 1
    return res

ans = 11
n = int(math.sqrt(N))
for i in range(n):
    a = i + 1
    if N % a == 0:
        b = N / a
    ans = min(ans, max(keta(a), keta(b)))
print(ans)

Solution (Python):
N = int(input())

divisor = []

for i in range(int(N ** 0.5)+1, 0, -1):
    if N % i == 0:
        divisor.append(i)
        break

B = N // divisor[0]

if len(str(divisor[0])) > len(str(B)):
    print(len(str(divisor[0])))
else:
    print(len(str(B)))

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
anslist = []
N = int(input())
for div in make_divisors(N):
  div2 = N//div
  anslist.append(max(len(str(div)),len(str(div2))))
print(min(anslist))

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

Solution (Python):
N = int(input())

import math
sqrtN = int(math.sqrt(N))

def F(a, b):
    return max(len(str(a)), len(str(b)))

best = 10*9
for n in range(1, sqrtN+1):
    q, mod = divmod(N, n)
    if n * q != N:
        continue
    v = F(n, q)
    if v < best:
        best = v

print(best)

Solution (Python):
import math

def count(a, b):
    a = len(str(a))
    b = len(str(b))

    return max(a, b)

N = int(input())
ans = 10**10

for a in range(1, math.ceil(math.sqrt(N))+1):
    if not N % a:
        b = N//a
        ans = min(ans, count(a, b))
print(ans)

Solution (Python):
n = int(input())

min_digits = 100
for i in range(int(n ** 0.5) + 1):
    a = i + 1
    if n % a != 0:
        continue
    b = n // a
    x = max([a, b])
    digits = len(str(x))
    if digits < min_digits:
        min_digits = digits

print(min_digits)

Solution (Python):
N = int(input())
y = []
for i in range(1, int(N ** .5) + 1):
    if N % i == 0:
        y.append(i)
ans = float('inf')
for n in y:
    ans = min(ans, max(len(list(str(n))), len(list(str(N // n)))))
print(ans)

Solution (Python):
import math
N = int(input())

dvs = []
pair = []
digit = []

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



for i in range(len(pair)):
  digitA = int(math.log10(pair[i][0])) + 1
  digitB = int(math.log10(pair[i][1])) + 1
  digit.append(max(digitA, digitB))

ans = min(digit)
print(ans)

Solution (Python):
import math
N = int(input())
max_div = math.ceil(math.sqrt(N))
ans = 10 ** 18

for i in range(1, max_div + 1):
    if N % i == 0:
        ans = min(ans, int(max((math.log10(N // i) + 1, math.log10(i) + 1))))

print(ans)

Solution (Python):
n=int(input())

x=int(n**0.5)

for i in range(x,0,-1):
    if n%i==0:
        a=str(i)
        b=str(n//i)
        print(max(len(a),len(b)))
        break

Solution (Python):
N = int(input())
ans = 10 ** 18
for i in range(10 ** 5, 0, -1):
     if N % i == 0:


        ans = min(max(len(str(N // i)),len(str(i))), ans)
print(ans)

Solution (Python):
import math
N=int(input())
for i in reversed(range(1,math.ceil(math.sqrt(N))+1)):
    if N%i==0:
        B=N//i
        print(math.floor(math.log10(B))+1)
        break

Solution (Python):
import math
n = int(input())
val = n
vals = []
for i in range(1, math.ceil(val**0.5) + 1):
    if val % i == 0:
        vals.append(i)
        
ans = float('inf')
for v in vals:
    ans = min(ans, max(len(str(v)), len(str(n // v))))
print(ans)

Solution (Python):
n = int(input())

min_len = len(str(n))
for i in range(2,int(n**(1/2))+1):
    if n%i==0:
        l = max(len(str(i)), len(str(n//i)))
        min_len = min(min_len, l)


print(min_len)

Solution (Python):
from math import sqrt
n=int(input())
ans=[]
k=int(sqrt(n))
for i in range(1,k+1):
    if n%i==0:
        ans.append(len(str(int(n/i))))
ans.sort()
print(ans[0])

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

ans=10**9
for i in range(1,int(n**0.5)+1):
  if n%i==0:
    ans=min(ans,f(i,n//i))
print(ans)

Solution (Python):
import math
N=int(input())
ans=10**5
for i in range(1, int(math.sqrt(N))+1):
    if int(N/i) != N/i:
        continue
    else:
        j = int(N/i)
        ans = min(ans, max(len(str(i)), len(str(j))))
print(ans)

Solution (Python):
N = int(input())
import math as m
div = []

for i in range(1,int(m.sqrt(N))+1):
    if N % i == 0:
        div.append(i)

min = float("inf")
for i in div:
    if max(len(str(i)),len(str(N//i))) <= min:
        min = max(len(str(i)),len(str(N//i)))
print(min)

Solution (Python):
N = int(input())

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

ans = 10**10
for a in make_l(N):
    ans = min(ans , max(len(str(a)) , len(str(int(N/a)))))
print(ans)

Solution (Python):

def func(A,B):
    return max(len(str(A)),len(str(B)))

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

    divisors.sort()
    return divisors

def main():
    N = int(input())
    divisors = enum_divisors(N)
    res = float('inf')
    for i in range(len(divisors)):
        A = divisors[i]
        B = int(N/A)
        if B < A:
            break
        res = min(res,func(A,B))

    print(res)

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
F = []
for i in range(1,int(n**0.5)+1):
    if n%i == 0:
        F.append(max(len(str(i)),len(str(n//i))))
print(min(F))

Solution (Python):
n = int(input())

F = []
for i in range(1,int(n**0.5)+1):
    if n%i == 0:
        a,b = i,n//i
        if len(str(a)) >= len(str(b)):
            F.append(len(str(a)))
        else:
            F.append(len(str(b)))
print(min(F))

Solution (Python):
def ndigits(A):
    ret = 0
    while A > 0:
        ret += 1
        A //= 10
    return ret


def F(A, B):
    return max(ndigits(A), ndigits(B))


def main():
    N = int(input())
    x = 1
    ans = float("inf")
    while x*x <= N:
        if N % x == 0:
            ans = min(ans, F(x, N//x))
        x += 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
f=[10]*int(n**0.5)
for a in range(int(n**0.5)):
    b=n/(a+1)
    if b-int(b)==0:
        f[a]=max(len(str(a)), len(str(int(b))))
print(min(f))

Solution (Python):
N=int(input())
data=dict()
check=2
now=N
bef=1
while check<1+int(N**0.5):
    if now==1:break
    if now<=int(N**0.5):break
    if now%check==0:
        now//=check
        bef*=check
        if check in data:
            data[check]+=1
        elif check not in data:
            data[check]=1
    else:
        check+=1
if now!=1:
    if now not in data:
        data[now]=1
    elif now in data:
        data[now]+=1
if len(data)==0:
    print(len(str(N)))
else:
    A=1
    B=1
    
    while len(data)>0:
        big=max(data.keys())
        if B<A:
            A,B=B,A
        if len(str(B*big))==len(str(B)):
            B*=big
        else:
            A*=big
        data[big]-=1
        if data[big]==0:
            data.pop(big)
    print(len(str(max(A,B))))

Solution (Python):
n = int(input())

for i in range(1, int(n ** (1/2)+1)):
    if n % i == 0:
        t = n // i

print(len(str(t)))

Solution (Python):
n=int(input())
ans=9999
for i in range(1,int(n**(1/2))+1):
    if n%i==0:
        f=max(len(str(i)),len(str(n//i)))
        if f<ans:
            ans=f
print(ans)

Solution (Python):
N = input()

i = 1
ans = 99
while i*i<=N:
  if N%i==0:
    ans = min(ans, max(len(str(i)), len(str(N/i))))
  i += 1
print ans

Solution (Python):
import math

def F(A,B):
    checkA = len(str(A))
    checkB = len(str(B))
    return max(checkA, checkB)
    
N = int(input())
min = N**2

for i in range(1, int(math.sqrt(N))+1):
    if N % i == 0:
        tmp = F(i, int(N/i))
        if tmp < min:
            min = tmp

print(min)

Solution (Python):
def F(A, B):
  return max(len(str(A)), len(str(B)))

res = 10
N = input()
for i in range(1, 10**5):
  if N % i == 0:
    res = min(res, F(i, N / i))
print res

Solution (Python):
import math

N = int(input())

anss = []
for n in range(1,math.ceil(N**0.5)+1):
	if N % n == 0:
		anss.append(max(len(str(n)),len(str(N//n))))

if len(anss) == 0:
	anss.append(1)
		
print(min(anss))

Solution (Python):
N = int(input())
ans = N
for i in range(1,int(N**0.5)+1):
	if N%i == 0:
		a = len(str(int(N/i)))
	if a < ans:
		ans = a
print(ans)

Solution (Python):

import math
N=int(input())
a=1
for n in range(1,int(N**(1/2))+1):
	if N%n==0:
		a=n
print(max(len(str(a)),len(str(N//a))))

Solution (Python):
import math
n = int(input())
m = int(math.sqrt(n))

for i in range(m+1,0,-1):
    if n % i == 0:
        a = i
        b = n//i
        break

print(max(len(str(a)),len(str(b))))

Solution (Python):
n = int(input())
l = [[i, n//i] for i in range(1, int(n**0.5)+1) if n % i == 0]
print(max(len(str(l[-1][0])), len(str(l[-1][1]))))

Solution (Python):
n = int(input())

max_a = int(pow(n, 1/2))

ans = 999
for a in range(1, max_a + 1):
    if n % a == 0:
        b = n // a
        temp = 1
        while b >= 10:
            b //= 10
            temp += 1
        ans = min(ans, temp)

print(ans)

Solution (Python):
N = int(input())
ans = 10000000

for A in range(1, int(N ** 0.5) + 1):
    if N % A == 0:
        B = int(N / A)
        keta = len(str(B))
        if keta < ans:
            ans = keta
print(ans)

Solution (Python):
import math

n=int(input())
l=len(str(n))
m=math.floor(n**0.5)
max=1
for i in range(1,m+1):
    if n%i==0:
        max=i
ans=len(str(n//max))
print(ans)

Solution (Python):
def main():
    n = int(input())
    print(solve(n))

def solve(n):
    i = 1
    m = 0
    while i * i <= n:
        if n % i == 0:
            m = i
        i += 1

    return intlog10(n // m)

def intlog10(n):
    return len(str(n))

main()

Solution (Python):
N=int(input())
a=1
for i in range(1,int(N**0.5)+1):
    if N%i==0:
        a=i

print(len(str(N//a)))

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

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

Solution (Python):

"""
Created on Tue Mar  5 17:48:45 2019

@author: yuta
"""
import math
N = int(input())

def main(n):
    sqrt_n = math.sqrt(n)
    min_keta = len(str(n))
    for i in range(1,int(sqrt_n)+1):
        if n % i == 0:
            j = int(n/i)
            max_num = max(i,j)
            c = len(str(max_num))
            if c < min_keta:
                min_keta = c
    print(min_keta)
main(N)

Solution (Python):
import math
n=int(input())
l=[]
for i in range(1,int(math.sqrt(n))+2):
    if n%i==0:
        l+=[max(len(str(i)),len(str(n//i)))]
print(min(l))

Solution (Python):
import math
n=int(input())
l=[]
for i in range(1,int(math.sqrt(n))+2):
    if n%i==0:
        l+=[max(len(str(i)),len(str(n//i)))]
print(min(l))

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007






n = I()
ans = int(math.log10(n)+1)
for i in range(2,int(n**0.5)+1):
    if n%i == 0:
        ans = min(ans, max(int(math.log10(i)+1),int(math.log10(n//i)+1)))
print(ans)

Solution (Python):
import math
n = int(input())
m = int(math.sqrt(n))
f = 10**10

for i in range(1,m+1):
    if n % i == 0:
        f = min(f, max(len(str(i)), len(str(n//i))))

print(f)

Solution (Python):
n = int(input())

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

Solution (Python):
N = int(input())
rootn = int((N**0.5) +1)
A = range(1, rootn)
min_digits = 11
for i in A:
    if (N % i) == 0:
        B = N // i
        p, q =len(str(i)), len(str(B))
        if (p > q) and (p < min_digits):
            min_digits = p
        elif (p <= q) and (q < min_digits):
            min_digits = q
print(min_digits)

Solution (Python):


















import math
import numpy as np
import copy
from collections import defaultdict, Counter
from itertools import product
from bisect import bisect_left, bisect_right
def inpl(): return list(map(int, input().split()))

def cnt_digits(N):
    digits = 1
    while N>=10:
        N /= 10
        digits += 1
    return digits

N = int(input())

ans = cnt_digits(N)

for A in range(1, int(math.sqrt(N))+1):
    if N % A != 0:
        continue
    B = N//A

    tmp = max(cnt_digits(A), cnt_digits(B))
    ans = min(ans, tmp)

print(ans)

Solution (Python):
def f(a, b):
    al = len(str(int(a)))
    bl = len(str(int(b)))
    if al > bl:
        return al
    return bl
N = int(input())
result = len(str(N))
for a in range(1, N):
    if a*a > N:
        break
    if (N % a) != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)

Solution (Python):
def f(n):
    rootn = int((N**0.5)+1)
    A = range(1, rootn)
    min_output = 11
    for i in A:
        if (N % i) == 0:
            ilen = len(str(i))
            B = len(str(N//i))
            if ilen < B:
                if min_output > B:
                    min_output = B
            else:
                if min_output > ilen:
                    min_output = ilen
    return min_output
N = int(input())
print(f(N))

Solution (Python):
n = int(input())

def make_divisor_list(n):
  divisor_list = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisor_list.append(i)
      if i != n // i:
        divisor_list.append(n//i)
  divisor_list = sorted(divisor_list)
  return divisor_list
  
li = make_divisor_list(n)

if len(li)%2 ==1:
  print(len(str(li[len(li)//2])))
else:
  print(max(len(str(li[len(li)//2-1])),len(str(li[len(li)//2]))))

Solution (Python):
import math
ab = n = int(input())
sqrt = math.sqrt(n)
ans = 0
for i in range(int(sqrt)+1):
  if n % (i+1) == 0:
    ab = min(n/(i+1), ab)
while(ab > 0):
  ab = ab // 10
  ans += 1
print(ans)

Solution (Python):
N = int(input())

def gk(n):
    ans = 0
    while n:
        ans += 1
        n //= 10
    return ans


ans = float("inf")
for i in range(1, int(N**(1/2))+1):
    if N % i == 0:
        ans = min(ans,gk( N//i)) 
print(ans)
exit(0)


lst = []
for i in range(2,int(N**(1/2))+1):
    if N % i == 0:
        ans = 0
        while N % i == 0:
            ans += 1
            N //= i
        lst.append( (i,ans) )

cand = [1]
while lst:
    p,cnt = lst.pop()
    nl = []

Solution (Python):
N = int(input())
ans = 100
for A in range(1, int(N ** 0.5) + 1):
    if N % A != 0:
        continue
    F = max(len(str(A)), len(str(N // A)))
    ans = min(ans, F)
print(ans)

Solution (Python):
import math
n=int(input())
k = math.floor(math.sqrt(n))
for a in range(k+1,0,-1):
    if n % a == 0:
        print(max(len(str(a)),len(str(n//a))))
        break

Solution (Python):
import math
n = int(input())
k = math.floor(math.sqrt(n))
for i in range(k+1,0,-1):
    if n%i==0:
        print(max(len(str(n//i)),len(str(i))))
        break

Solution (Python):
N = int(input())
x = round(N**0.5)
while N%x != 0:
  x -= 1
print(len(str(N//x)))

Solution (Python):
N = int(input())

def prime_factor(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

res = prime_factor(N)

result = 10 ** 10
for i in range(1, N+1):
    if N%i == 0:
        result = min(result, max(len(str(i)), len(str(N//i))))
    if i*i > N:
        break


print(result)

Solution (Python):
n = int(input())
divi = []
for i in range(1,round(n**(1/2)+2)):
    if n% i == 0:
        divi += [i]
print(len(str(n//max(divi))))

Solution (Python):
import math

N=int(input())
arr=[]
for i in range(math.ceil(math.sqrt(N))):
    
    if N%(i+1)==0:
        
        arr.append(max(math.log10(i+1),math.log10(N//(i+1))))
        
print(math.floor(min(arr))+1)

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    N = int(sys.stdin.readline())

    for N_ in range(math.floor(math.sqrt(N)), -1, -1):
        if N % N_ == 0:
            M = N // N_
            print(len(str(M)))
            return

main()

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

Solution (Python):
n = int(input())
i = round(n**.5)
while n%i != 0:
  i -= 1
print(len(str(n//i)))

Solution (Python):
n = int(input())
for i in range(round(n**.5),0,-1):
    if n % i == 0:
        print(len(str(n//i)))
        exit()

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

Solution (Python):
n=int(input())
A=[]
for i in range(1,int(n**(1/2)+1)):
  if n%i==0:
    
    A.append(i)
    
b=A[-1]
c=n//b
print(max(len(str(b)),len(str(c))))

Solution (Python):
import math
n = int(input())
def f(n):
  g = float('inf')
  for i in [j for j in range(1,math.ceil(n**0.5)+1) if n%j == 0]:
    if g > len(str(max(i,n//i))):
      g = len(str(max(i,n//i)))
    if g == float('inf'):
        g = 1
  return g
print(f(n))

Solution (Python):
n = int(input())
ans = len(str(n))
for a in range(1, round(n ** (1/2)) + 1):
  if n % a == 0:
    b = n // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

Solution (Python):
import math

N = int(input())

ans = 0
start = math.ceil(math.sqrt(N))
while ans == 0:
    if N%start == 0:
        ans = max(len(str(int(start))),len(str(int(N/start))))
    start -= 1

print(ans)

Solution (Python):
import math
n=int(input())
ceil=math.ceil(math.sqrt(n))
def f(a,b):
  return max(len(str(a)),len(str(b)))
tmp=10**9
for a in range(1,ceil+1):
  if n%a==0:
    b=n//a
    tmp=min(tmp,f(a,b))
print(tmp)

Solution (Python):
N = int(input())

m = int(N **0.5)+1
for i in range(1,m):
    j = N // i
    if i*j < N:
        continue
    k = i
a = N // k
ans=0
b = str(a)
ans = len(b)

print(ans)

Solution (Python):
N = int(input())
list = []
for i in range(int(N/2)+1):
    A = i+1
    B = N / A
    if A > B:
        break
    
    if int(A) * int(B) == N:
        if len(str(int(A))) >= len(str(int(B))):
            list.append(len(str(int(A))))
        else:
            list.append(len(str(int(B))))

print(min(list))

Solution (Python):
import math

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

for i in range(1,int(math.sqrt(N))+1,1):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))

Solution (Python):
from math import sqrt,floor
N = int(input())
div = set()
for i in range(1,floor(sqrt(N))+1):
    if N % i == 0:
        div.add(max(len(str(i)), len(str(N//i))))
print(min(div))

Solution (Python):
import math

N = int(input())
if N <= 9:
    ans = 1
else:
    ans = 11
for n in range(1, int(math.sqrt(N))+1):
    if N % n == 0:
        
        f = max(len(str(n)), len(str(int(N/n))))
        if f < ans:
            
            ans = f
print(ans)

Solution (Python):
import math

N = int(input())
N_max = math.floor(pow(N, 0.5))

ans = math.floor(math.log10(N)) + 1

for i in range(1, N_max+1):
    if N % i == 0:
        M = N / i
        digI = math.floor(math.log10(i)) + 1
        digM = math.floor(math.log10(M)) + 1
        if digI >= digM:
            score = digI
        else:
            score = digM

        if score <= ans:
            ans = score

print(ans)

Solution (Python):
from math import sqrt, floor
N = int(input())
a = 1
for i in range(2, floor(sqrt(N)) + 10):
    if N % i == 0:
        a = i

print(max(len(str(a)), len(str(N // a))))

Solution (Python):





n = int(raw_input())
ans, i = n, 1
while i * i <= n:
    if n % i == 0:
        ans = min(ans, n / i)
    i += 1
print len(str(ans))

Solution (Python):
N = int(input())
larger = 0
for i in range(1, N + 1):
    if i*i > N:
        break
    if N % i == 0:
        larger = N // i

ans = 0
while larger > 0:
    ans += 1
    larger //= 10
print(ans)

Solution (Python):
import math


def Primes(n):
    Prime = []
    Table = list(range(2, n+1))
    for k in range(2, int(math.sqrt(n))+1):
        if k == Table[0]:
            Prime.append(Table[0])
            Table = [i for i in Table if i % k]
    return Prime + Table if n >= 2 else []



def PrimeDecomp(m):
    n = m
    Dict = {}
    for p in Primes(int(math.sqrt(m))):
        for _ in range(1, m):
            if n % p == 0:
                n //= p
                Dict.setdefault(p, 0)
                Dict[p] += 1
            else:
                break
    if n > 1:
        Dict[n] = 1
    return Dict



def Divisors(m):
    Divisor = [1]
    for p in PrimeDecomp(m).keys():
        Table = []
        for j in range(PrimeDecomp(m)[p]+1):
            Table.extend([d*p**j for d in Divisor])
        Divisor = Table
    return sorted(Divisor)


Div = Divisors(int(input()))
print(len(str(Div[len(Div)//2])))

Solution (Python):
import math


N = int(input())
minF = 100 


F = int(math.log10(N)) +1
if F < minF:
    minF = F
    
for A in range(2,int(math.sqrt(N)) + 1):
    
    if N % A == 0:
        B = N / A
        
        F = int(math.log10(B)) + 1
        
        if F < minF:
            minF = F

print(minF)

Solution (Python):
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

if N == 1:
    print(1)
else:
    C = res(0, [], [])
    print(min(C))

Solution (Python):
n = int(input())
ans = n
for a in range(int(n ** (0.5)), 0, -1):
    if n % a == 0:
        b = n // a
        tmp = max(len(str(a)), len(str(b)))
        ans = min(ans, tmp)
print(ans)

Solution (Python):
import math
N = int(input())

div = []
for i in range(1, int(math.sqrt(N))+1):
    if N % i == 0:
        div.append((i, N//i))
ans = 30
for elem in div:
    _, a = elem
    res = len(str(a))
    ans = min(ans, res)
print(ans)

Solution (Python):
import math
N = int(input())

div = []
for i in range(1, int(math.sqrt(N))+1):
    if N % i == 0:
        div.append((i, N//i))
ans = 30
for elem in div:
    _, a = elem
    cnt = 0
    while a > 0:
        a //= 10
        cnt += 1
    ans = min(ans, cnt)
print(ans)

Solution (Python):
n = int(input())

a = 0
ans = len(str(n))

while a*a <= n:
    a += 1
    if n%a != 0:
        continue
    b = int(n/a)
    cur = max(len(str(a)), len(str(b)))
    ans = min(ans, cur)

print(ans)

Solution (Python):
import math
n = int(input())

dig = float('inf')
for a in range(1, int(math.sqrt(n)) + 1):
    if n % a:
        continue
    b = n // a
    tmp = max(int(math.log10(a)), int(math.log10(b))) + 1
    if tmp < dig:
        dig = tmp

print(dig)

Solution (Python):
N = int(input())

root_N = pow(N,1/2)

ans = 1000
for i in range(int(root_N)+1):
	A = i+1
	if N%A == 0:
		B = N//A
		ans_l = max(len(str(A)), len(str(B)))
		ans = min(ans,ans_l)
print(ans)

Solution (Python):


def main():
    n = int(input())
    a = largest_nonlarger_dividor(n)
    b = n // a
    print(len(str(b)))

def largest_nonlarger_dividor(n):
    assert n > 0
    res = 1
    for i in range(2, int(n ** 0.5) + 10):
        if i ** 2 > n:
            break
        if n % i == 0:
            res = i
    return res

main()

Solution (Python):


n = int(input())
a = 1
ans = 100
while a * a <= n:
    if n % a == 0:
        b = n // a
        ans = min(ans, max(len(str(a)) , len(str(b))))
    a += 1
print(ans)