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):
def smaller(x, y):
	if x < y:
		return x
	return y
def larger(x, y):
	if x > y:
		return x
	return y

prime = []
numberlist = []
for i in range(2, 100001):
	numberlist.append(i)
while numberlist[0] <= 316:
	now = numberlist.pop(0)
	prime.append(now)
	newnumberlist = []
	for i in range(0, len(numberlist)):
		if numberlist[i] % now != 0:
			newnumberlist.append(numberlist[i])
	numberlist = newnumberlist
prime = prime + numberlist

N = int(input())
M = N
countlist = []
for i in range(0, len(prime)):
	countlist.append(0)
for i in range(0, len(prime)):
	while N % prime[i] == 0:
		countlist[i] += 1
		N //= prime[i]
numberlist = [1]
for i in range(0, len(prime)):
	genlist = [1]
	for j in range(0, countlist[i]):
		genlist.append(prime[i]*genlist[-1])
	newnumberlist = []
	for j in range(0, len(genlist)):
		for k in range(0, len(numberlist)):
			newnumberlist.append(genlist[j]*numberlist[k])
	numberlist = newnumberlist
min = 5000000000000000
for i in range(0, len(numberlist)):
	min = smaller(min, larger(len(str(M//numberlist[i])), len(str(numberlist[i]))))
print(min)

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a, b = LI()
    print((a+b)%24)
    return


def B():
    n, m = LI()
    ab = LIR(n)
    cd = LIR(m)
    for a, b in ab:
        ans = inf
        an = 0
        for num, cdi in enumerate(cd):
            c, d = cdi
            if ans > abs(a - c) + abs(b - d):
                ans = abs(a - c) + abs(b - d)
                an = num
        print(an+1) 
    return


def C():
    n = II()
    ans = inf
    for i in range(1, int(math.sqrt(n)) + 1):
        if not n % i:
            ans = min(ans, max(int(math.log(i, 10)), int(math.log(n // i, 10))))
    print(ans+1)
    return


def D():
    return


if __name__ == '__main__':
    C()

Solution (Python):
N = int(input())
def is_square(n):
    m = int(n**.5)
    return True if abs(m*m - n) < 1e-6 else False
divs = []
f = False
if is_square(N):
    divs = [int(N**.5)]*2
    f = True
for i in range(int(N**.5),0,-1):
    if f: break
    if N % i == 0: divs += [i, N//i]
    if len(divs) >= 2: break
print(max([len(str(x)) for x in divs]))

Solution (Python):
import math
def digit_num(N):
    if N < 10:
        return 1
    return 1 + digit_num(N // 10)

N = int(input())
ans = 15
for i in range(1, int(math.sqrt(N)) + 1):
    if N % i == 0:
        ans = min(ans, max(digit_num(i), digit_num(N // i)))
        
print(ans)

Solution (Python):

import math

n = int(input())



tmp= math.ceil(math.sqrt(n))


for i in range(0,tmp):
	if(n%(tmp-i)==0):
		break


ansn=n//(tmp-i)




ans=math.floor(math.log10(max(ansn,tmp-i))) + 1

print(ans)

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

def F(A):
     return len(str(A))

upper_bound = int(N ** (0.5))
ans = float("inf")
for i in range(1, upper_bound + 1):
     if N % i == 0:
          j = N // i
          ans = min(ans, F(j))
print(ans)

Solution (Python):
N=int(input())
m=int(N**0.5)
while True:
    if N%m==0:
        print(len(str(N//m)))
        exit()
    else:
        m-=1

Solution (Python):

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    num = int(input())
    ans = len(str(num))
    for i in range(1, int(num ** 0.5) + 1):
        if num % i == 0:
            
            a = i
            b = num // a
            kari = max(len(str(a)), len(str(b)))
            ans = min(ans, kari)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def m_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return m_c_d(y, x % y)


a = int(input())
b = 0
for i in range(int(a ** 0.5 + 1), 1, -1):
    b = max(m_c_d(a, i), b)
print(max(len(str(b)), len(str(a // b))))

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

ans = 11
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())
small = [1]
large = [n]
for i in range(2,int(n**0.5)+1):
    if not (n%i):
        small.append(i)
        large.append(n//i)
print(int(math.log10(large[-1]))+1)

Solution (Python):
import sys
from math import sqrt

def solve(N):
    def f(a, b):
        return max([ len(str(x)) for x in [a, b] ])

    m = float('inf')
    i = 1
    imax = sqrt(N)
    while i <= imax:
        if N % i == 0:
            m = min(m, f(i, N // i))
        i += 1

    print(m)

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

if __name__ == "__main__":
    main()

Solution (Python):
import math
import itertools

INF = 10**9+7
n = 0
def main():
	ans = INF
	n = int(input())
	for i in range(1,int(math.sqrt(n)) + 1):
		if(n%i==0):
			m = int(n/i)
			d = div(m)
			if(ans > d):
				ans = d

	print(ans)

def div(n):
	ans = 1
	while n >= 10:
		ans+=1
		n/=10
	return ans

main()

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

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

Solution (Python):
import math
N = int(input())
mi = float("inf")
def F(x, y):
    return max(len(str(x)), len(str(y)))

for A in range(1, math.floor(math.sqrt(N))+1):
    if N % A == 0:
        B = N // A
        mi = min(F(A, B), mi)
print(mi)

Solution (Python):
import math

n = int(input())

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

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

print(ans_min)

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

chk1 = 0
chk2 = 0
max_len = 100000000000

for i in range(1,int(n**0.5)+1):
    
    chk = n/i
    if chk.is_integer():
        i_len = len(str(i))
        chk_len = len(str(int(chk)))
        if max(i_len,chk_len) < max_len:
            
            max_len = max(i_len,chk_len)

print(max_len)

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

Solution (Python):


import math

def main(N):
    A = []
    for i in range(1, int(math.sqrt(N))+1):
        if(N%i==0):
            A.append(i)
    ans = float("INF")
    for i in range(len(A)):
        ans = min(ans, F(A[i], int(N/A[i])))
    print(ans)
    
def F(A, B):
    if len(str(A))>=len(str(B)):
        return len(str(A))
    else:
        return len(str(B))

if __name__ == '__main__':
    N = int(input())
    
    main(N)

Solution (Python):

N = int(input())

cnt = 1
ans = float("inf")

while cnt ** 2 <= N:

    now = 0

    if N % cnt == 0:

        now = N // cnt

        keta = 1
        while True:

            if 10 ** keta > now:
                break
            keta += 1

        ans = min (keta,ans)

    cnt += 1

print (ans)

Solution (Python):


import math


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h() if m > 1 else typ(input()) for _ in range(n)]


def main():
    N, = read_h()

    ans = 100
    for a in range(1, int(math.sqrt(N)) + 1):
        if N % a != 0:
            continue

        b = N // a
        f = max(len(str(a)), len(str(b)))
        ans = min(ans, f)

    print(ans)


if __name__ == '__main__':
    main()

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

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)
div2 = div.copy()
div2.reverse()
n = len(div2)//2
print(max(len(str(div[n])), len(str(div2[n]))))

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

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

    
    return divisors

X = make_divisors(N)
ans = 10

for i in X:
    ans = min(ans, max(len(str(i[0])), len(str(i[1]))))

print(ans)

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

Solution (Python):
import math
N = int(input())
N_sqrt = math.floor(math.sqrt(N))

ans = float('inf')
for i in range(1, N_sqrt + 1):
    if N % i == 0:
        if ans > max(len(str(i)), len(str(N // i))):
            ans = max(len(str(i)), len(str(N // i)))

print(ans)

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

Solution (Python):
import math

def calc(N):
    ans = N

    v2 = int(math.sqrt(N))
    if N == v2 * v2:
        ans = v2 
    else:
        v3 = v2 + 1
        for v in range(2, v3):
            div = int(N / v)
            if div * v == N:
                rc = max(v, div)
                if rc < ans:
                    ans = rc

    return ans


N = int(input())
v = calc(N)
print(len(str(v)))

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
l=make_divisors(n)
print(len(str(max(l[len(l)//2],l[len(l)//2-1]))))

Solution (Python):
def digit_len(n):
    result = 0
    while n > 0:
        result += 1
        n //= 10
    return result

result = 10 * 2
N = int(input())
for d in range(1, N + 1):
    if d * d > N:
        break
    if N % d == 0:
        result = min(result, max(digit_len(d), digit_len(N // d)))
print(result)

Solution (Python):
import sys
input = sys.stdin.readline

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)
    return divisors
                
def main():
    n = int(input())
    n1 = sorted(make_divisors(n))

    mn = 10 ** 10
    for i in n1:
        mn = min(mn, max(len(str(n // i)), len(str(i))))
    print(mn)


if __name__ == "__main__":
    main()

Solution (Python):

import sys
sys.setrecursionlimit(300000)


def solve(N: int):
    i = 1
    ret = float('inf')
    while i * i <= N:
        if N % i == 0:
            tmp = N // i
            ret = min(ret, max(len(str(i)), len(str(tmp))))
        i += 1
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
def count_order(x):
    count = 1
    while True:
        x = int(x/10)
        if x != 0:
            count += 1
        else:
            break
    return count

def F(A,B):
    a = count_order(A)
    b = count_order(B)
    if a > b:
        return a
    else:
        return b
min_order = 10
for A in range(1, int(N**0.5)+1):
    if N % A == 0:
        B = N / A
        
        order = F(A,B)
        if order < min_order:
            min_order = order
print(min_order)

Solution (Python):
import numpy as np


N = int(input())


def F(A, B):
    C = np.vstack((A, B))
    digit_C = np.array(np.log10(C) + 1, dtype = int)
    return np.max(digit_C, axis = 0)


divisor = np.arange(1, int(N ** 0.5) + 1)

quotient = N // divisor
residue = N % divisor


A = divisor[residue == 0]
B = quotient[residue == 0]


print(np.min(F(A, B)))

Solution (Python):


import math

N = int(input())
min_len = pow(10,10)

for i in range(1, math.ceil(math.sqrt(N)) + 1):
    if N % i == 0:
        if (len(str(i)) >= len(str(N // i))) and (min_len > len(str(i))):
            min_len = len(str(i))
        elif (len(str(i)) < len(str(N // i))) and (min_len > len(str(N // i))):
            min_len = len(str(N // i))
        else:
            continue
print(min_len)

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

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

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

l=make_divisors(n)
ans=10**9+7
for i in l:
    ans=min(ans,f(i,n//i))

print(ans)

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

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

l=make_divisors(n)
ans=10**9+7
for i in l:
    ans=min(ans,f(i,n//i))

print(ans)

Solution (Python):
n=int(input())
a,b=0,0
for i in range(1,n+1):
    if n%i==0:
        a=i
        b=n//i
    if i>n//i:
        break

alog,blog=1,1
i=0
while 1:
    a=a//10
    if a==0:
        break
    alog+=1

while 1:
    b=b//10
    if b==0:
        break
    blog+=1

print(max(alog,blog))

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

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

Solution (Python):
def main():
	N = int(input())
	d_i, d_div = 0, 0
	sqrt = int(N**0.5)
	for i in range(1, sqrt+1):
		div, mod = divmod(N, i)
		if mod == 0:
			d_i = i
			d_div = div
	ans = 0
	while d_div != 0:
		ans += 1
		d_div //= 10
	print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

def factorize(x: int) -> list:
    ret = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            ret = [i, x // i]
    return ret


def main():
    n = int(input())
    a, b = factorize(n)
    print(max(len(str(a)), len(str(b))))


if __name__ == "__main__":
    main()

Solution (Python):

def factorize(x: int) -> list:
    pairs = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            pairs += [(i, x // i)]
    return pairs


def main():
    n = int(input())
    a, b = factorize(n)[-1]
    print(max(len(str(a)), len(str(b))))


if __name__ == "__main__":
    main()

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

Solution (Python):
n=int(input())
s=int(n**(1/2))+1
l=[]
for i in range(1,s+1):
  if n%i==0:
    l.append([i,n//i])
def digit(a,b):
  return max(len(str(a)),len(str(b)))
ans=11
for i in range(len(l)):
  if ans>=digit(l[i][0],l[i][1]):
    ans=digit(l[i][0],l[i][1])
print(ans)

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):
import math

def keta(num):
  b = num
  count=0
  while b >= 1 :
    count+=1
    b= b//10
  return count

n = int(input())

min_f = keta(n)
for i in range(1, int(math.sqrt(n))+1):
  if n%i==0:
    f = max(keta(n//i),keta(i))
    if min_f > f:
      min_f = f
print(min_f)

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

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

B = N // A[-1]
print(len(str(B)))

Solution (Python):
import numpy as np
import copy


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

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

    assert t > 0
    n_digits = len(str(t))

    print(n_digits)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
x = 10**10
for i in range(1,int(n**0.5)+1):
    if n % i == 0:
        x = min(x,int(n/i))

for i in range(10):
    if x <10**(i+1) and x >= 10**i:
        print(i+1)
        break

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

ans = []
for i in range(1,int(N**(1/2)+1)):
    if N % i == 0:
        x = str(N//i)
        i = str(i)
        ans.append(max((len(x),len(i))))
print(min(ans))

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

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

for i in range(s,0,-1):
    if n%i == 0:
        print(max(len(str(i)),len(str(n//i))))
        exit()

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

for A in range(1,int(N**0.5)+1):
    if N/A==int(N/A):
        ans=min(ans,len(str(int(N/A))))

print(ans)

Solution (Python):
n=int(input())
ans=len(str(n))
i=1
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):
N = int(input())

from math import log10,ceil,floor
mini = int(log10(N))
digit =  floor(log10(N)**0.5)
for n in range(1,int(N**0.5) + 1):
    if N % n == 0:
        rev = N // n
        if floor(abs(log10(max(n,rev))-digit)) < floor(abs(mini - digit)):
            mini = floor(log10(max(n,rev)))
print(mini + 1)

Solution (Python):
n = int(input())
a = 0
t = 0
for i in range(1, n+1):
    a = n / i
    if(n % i == 0):
        t = i
    if(a <= i):
        break

b = max(int(n / t), t)
ans = 0
while(b >= 1):
    ans += 1
    b /= 10
print(ans)

Solution (Python):
n = int(input())
ans = len(str(n))
a = 0
while a**2 <= n:
    a += 1
    if n % a != 0:
        continue
    b = n // a
    cur = max(len(str(a)), len(str(b)))
    if ans > cur:
        ans = cur
print(ans)

Solution (Python):
n = int(input())
ans = 1e9
for i in range(1, int(n**(1/2))+1):
  j = n/i
  if j.is_integer():
    j = int(j)
    ans = min(ans, max(len(str(i)), len(str(j))))
print(ans)

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

a = 1
b = 1

'''
def get_prime(num):
    primes = {}
    origin_num = num
    primes[1] = 1

    tmp = int(math.sqrt(num) + 1)

    for i in range(2, tmp):
        while num % i == 0:
            num //= i

            if not (i in primes.keys()):
                primes[i] = 0
            primes[i] += 1

    if num != 1:
        primes[num] = 1

    if num == origin_num:
        primes[num] = 1

    return primes


prime_dic = get_prime(n)
prime_sorted = sorted(prime_dic.items(), key=lambda x: x[0], reverse=True)

for k, v in prime_sorted:
    for i in range(v):
        if a <= b:
            a *= k
        else:
            b *= k
'''


tmp = int(math.sqrt(n) + 1)

for i in range(1, tmp):
    if n % i == 0:
        a = i

b = int(n / a)

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

print(f)

Solution (Python):
from math import sqrt

N = int(input())

n = int(sqrt(N)) + 10
def f(A, B):
    a = len(str(A))
    b = len(str(B))
    return max(a, b)


ans = 10 ** 10
for i in range(1, n):
    if (N//i) * i == N:
        ans = min(ans, f(i, N//i))

print (ans)

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

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

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

import math
root = math.ceil(math.sqrt(n))

for i in range(1,root+1):
    if n%i==0:
        ans = n//i
print(len(str(ans)))

Solution (Python):
N = int(input())
B = N
for x in range(1,N+1):
  y = N//x
  if x > y:
    break
  if not N % x:
    B = y
    
answer = len(str(B))
print(answer)

Solution (Python):
n = int(input())
i = 1
num = 100000
while i <= n / i:
        if n % i == 0:
                num = min(num, max(len(str(i)), len(str(int(n/i)))))
        i += 1
print(num)

Solution (Python):
n = int(input())
pf={}
for i in range(1,int(n**0.5) + 1):
    if n % i == 0:
      pf[i] = pf.get(i,0) + 1
a = max(pf)
b = int(n/a)
ans = max(len(str(a)), len(str(b)))
print(ans)

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

answer = 10 ** 12
for i in range(1, int(N**(1/2))+1):
  if N % i == 0:
    answer = min(answer, max(len(str(i)), len(str(N//i))))

print(answer)

Solution (Python):
import math
N = int(input())
Upper = int(math.sqrt(N))+1
ans = len(str(N))

for i in range(1,Upper):
    if N%i == 0:
        ans = min(ans,len(str(N//i)))
print(ans)

Solution (Python):
def keta(n):
    cnt = 0
    while n>0:
        n=n//10
        cnt+=1
    return cnt
n = int(input())
minans = 10**10
i=0
while i**2<=n:
    i+=1
    if n%i!=0:
        continue
    j = n/i
    ans = max(keta(i),keta(j))
    minans=min(minans,ans)
    i+=1
print(minans)

Solution (Python):
n=int(input())
ans=20
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 sys
import math

N = int(sys.stdin.readline().rstrip())

def ndigits(n):
  return int(math.log10(n) + 1)



r = int(math.sqrt(N))

for i in range(r,0,-1):
  
  if N%i == 0:
    break

print(max(ndigits(i), ndigits(N/i)))

Solution (Python):
import numpy as np

n = int(input())

sqrt_n = int(round(np.sqrt(n)))

i = 0 

while True:
    if n % (sqrt_n+i) == 0:
        ans = [sqrt_n+i,int(n/(sqrt_n+i))]
        break
    
    if n % (sqrt_n-i) == 0:
        ans = [sqrt_n-i,int(n/(sqrt_n-i))]
        break
    
    i += 1

len_ans = [0,0]

len_ans[0] = len(str(ans[0])) 
len_ans[1] = len(str(ans[1])) 

print(max(len_ans))

Solution (Python):
import numpy as np

n=int(input())

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

ans=10*20
for i in range(int(np.sqrt(n))):
    if n%(i+1)==0:
        F=f(i+1,n//(i+1))
        if F<ans:
            ans=F
print(ans)

Solution (Python):
import math

n = int(input())
sq = int(math.sqrt(n))
ans = 0
for i in range(sq,0,-1):
  if n % i == 0:
    ans = i
    break
print(len(list(str(max(ans,n//ans)))))

Solution (Python):





n = int(input())


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


flag = False
for i in range(2, int(n ** 0.5) + 1):
    if n % i == 0:
        flag = True
        break

if flag is False:
    print(f(n))
    exit()

maxn = 10**9
for a in range(2, 10 ** 6):
    if n % a == 0:
        b = n / a
        maxn = min(maxn, max(f(b), f(a)))

print(maxn)

Solution (Python):
import math

def func(a, b):
	if len(str(a)) > len(str(b)): return len(str(a))
	return len(str(b))
N = int(input())
start = int(math.sqrt(N))
for i in range(0, start):
	if N%(start-i) == 0:
		print(func(start-i, N//(start-i)))
		break

Solution (Python):
n = int(input())
f = float('inf')
for a in range(1, int(n**0.5)+1):
    if n % a == 0:
        b = n // a
        x = max(len(str(a)), len(str(b)))
        if f > x:
            f = x
print(x)

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)
            
            
    divisors.sort()
    return divisors



def int2digit(num):
  return(len(str(num)))

lst = make_divisors(N)
B = N // lst[-1]
ans = int2digit(B)

print(ans)

Solution (Python):

n = int(input())

from math import sqrt,log10

ret = 11
for i in range(1,int(sqrt(n)+1)):
    if n%i==0:
        ret = min([ret,log10(n//i)+1])
print(int(ret))

Solution (Python):
import math
N = int(input())
ans = 10**10

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

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

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

a = 1
b = 1
buff = 1

def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

_list = divisor(N)
_list = sorted(_list)
med = len(_list)

if med % 2 == 0:
    ans = str(_list[int(med/2)])
else:
    ans = str(_list[med//2])

print(len(ans))

Solution (Python):
N = int(input())
a = 1
ans = 10
while a*a <= N:
    b, r = divmod(N, a)
    if r == 0:
        ans = min(ans, len(str(b)))
    a += 1
print(ans)

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

def keta(cnt,a):
    if 0 < a and a <= 9:
        return cnt 
    else : 
        cnt += 1
        a = a // 10
        
    return keta(cnt,a)

def zyou(a):
    n = 1
    while True :
        if a < n**2 :
            return n
        else : n += 1 
n = zyou(N)

for i in range(n,0,-1):
    if N % i == 0 :
        print("{}".format(keta(1,max(i,N//i))))
        break

Solution (Python):
import math
n = int(input())
f = 100
for i in range(1, math.floor(math.sqrt(n))+1):
    if n % i != 0: continue
    f = min(f, max(int(math.log10(i)+1), int(math.log10(n/i)+1)))
print(f)

Solution (Python):
import math
N = int(input())
lim = int(math.sqrt(N))
ans = 9999
for i in range(1,lim+1):
    if N % i == 0:
        temp = N //i
        cand = max(len(str(i)),len(str(temp)))
        if ans > cand:
            ans = cand


print(ans)

Solution (Python):
from math import floor, sqrt

n = int(input())
n_root = floor(sqrt(n))

result = 10000000000
for a in range(1, n_root + 1):
    if not n % a == 0:
        continue
    b = int(n / a)
    digit_a = len(str(a))
    digit_b = len(str(b))
    tmp = max(digit_a, digit_b)
    result = min(tmp, result)

print(result)

Solution (Python):
import math
N=int(input())
def F(a,b):
    al = len(str(a))
    bl = len(str(b))
    if al < bl:
        return bl
    else:
        return al

min = 10
for A in range(1,int(math.sqrt(N))+1):
    if N % A == 0:
        B = N // A
        f = F(A,B)
        if f < min:
            min = f
print(f)

Solution (Python):
def func(a, b):
	return max(map(len, map(str, [a, b])))

N = int(input())

min_dig = 10 ** 18
for i in range(1, int(N ** 0.5) + 1):
	if not N % i:
		j = N // i
		min_dig = min(min_dig, func(i, j))

print(min_dig)

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


a = 1 
b = 1 

for i in range(1, math.floor(math.sqrt(n))+1):
  if n % i == 0:
    a = i
b = n // a
print(max([len(list(str(int(a)))), len(list(str(int(b))))]))

Solution (Python):
n = int(input())
ns = int(n**0.5)
ans = []

for a in range(1, ns+1):
    if n%a == 0:
        b = n//a
        a_s = str(a)
        b_s = str(b)
        ans.append(max(len(a_s),len(b_s)))

print(min(ans))

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

Solution (Python):
import math

l = input().split()
N = int(l[0])

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

def f(a, b):
    da = digits(a)
    db = digits(b)
    return max(da, db)

limit = int(math.sqrt(N) + 1)


ans = 11

for i in range(1, limit):
    d = N // i
    if d*i == N:
        ans = min(ans, f(i, d))

print(ans)

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

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

N = int(input())
li = make_divisors(N)
ans = 10**10
for i in li:
    b = N//i
    ans = min(ans,max(len(str(i)),len(str(b))))

print(ans)

Solution (Python):

import math


def fact(N):
  ret = set()
  for i in range(1,math.ceil(N**(0.5))+1):
    if N % i == 0:
      ret.add(i)
  return ret


if __name__ == "__main__":
  N = int(input())  
  ret = fact(N)
  ans = len(str(N))
  for r in ret:
    ans = min(ans, max(len(str(r)), len(str(N//r))))
print(ans)

Solution (Python):



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))))

print(min(ans))

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

sqrt_N = int(math.sqrt(N))
min_F = float('inf')

for i in range(1,sqrt_N + 1):
    if N % i == 0:
        A = i
        B = N // i
        if min_F > max(len(str(A)),len(str(B))):
            min_F = max(len(str(A)),len(str(B)))

print(min_F)

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

for i in range(1,int(math.sqrt(N))+1)[::-1]:
    if N % i == 0:
        print(int(math.log10(N//i))+1)
        break

Solution (Python):


"""考え方
[入力例１]
10000

N = A * B より

A=10000, B=1
A=5000, B=2
A=2500, B=4
A=1250, B=8
A=1000, B=10
A=500, B=20
A=250, B=40
A=200, B=50
A=125, B=80
A=100, B=100
A=50, B=200  <-- ここまで来ると、Bの桁数が大きくなるいっぽうなので、最小値が更新されることはもうない
...

つまり、i = 1 ~ √N までを全探索しても、N<=10**10なので、計算量は高々10**5 これは間に合う。

"""
import math

def F(A, B):
    """ 10進表記における、Aの桁数とBの桁数のうち大きい方を返す """
    def keta(n):
        """ 桁数を求める """
        ans = 1
        while True:
            n = n // 10
            if n == 0:
                break
            ans += 1
        return ans
    
    return max(keta(A), keta(B))
    

def solve():
    N = int(input())
    ans = float("inf")

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

        ans = min(ans, F(A, B))

    print(ans)

if __name__ == "__main__":
    solve()