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):
import math
N=input()

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


def div_list(num):
    if num == 1:
        return [1]
    else:
        l = []
        l.append(1)
        for i in range(2, int(math.sqrt(num)) + 1):
            if num % i == 0:
                l.append(i)

        return l

a=div_list(N)

ans=11
for i in a:
	ans=min(ans,F(i,N/i))

print ans

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

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


def div_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        l = []
        l.append(1)
        for i in range(2, int(math.sqrt(num)) + 1):
            if num % i == 0:
                l.append(i)
        l.append(num)

        return l

a=div_list(N)


ans=11
for i in a:
	ans=min(ans,F(i,N/i))

print ans

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

x = int(pow(N, 0.5))
while N % x != 0:
    x -= 1
print(len(str(N // x)))

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

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

    min_length = 11
    for a in range(1, int(N ** 0.5) + 1):
        if N % a == 0:
            min_length = min(min_length, max(len(list(str(a))), len(list(str(N // a)))))

    print(min_length)


solve()

Solution (Python):
import math
def F(a,b):
    return max(len(str(a)), len(str(b)))
    
def main():
    n =int(input())
    v = F(n,1)
    
    for a in range(1, int(math.sqrt(n))+1):
        if n % a != 0:
            continue
        
        b = n//a
        v = min(v, F(a,b))
    print(v)

if __name__ == "__main__":
    main()

Solution (Python):
import math

N = int(input())
ret = float('inf')
i = 1

while i * i <= N:
    if N % i == 0:
        ret = min(ret, int(math.log10(N / i)) + 1)
    i += 1

print(ret)

Solution (Python):
import math

N = int(input())
ret = float('inf')
i = 1

while i * i <= N:
    if N % i == 0:
        ret = min(ret, int(max(math.log10(i), math.log10(N/i))) + 1)
    i += 1

print(ret)

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

for A in range(1, int(math.sqrt(N))+2):
  if N % A == 0:
    F = len(str((N//A)))

print (F)

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 = min(ans, max(len(str(i)), len(str(n // i))))
print(ans)

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


ans=N
for a in range(1,N):
    if a*a > N:
        break

    if(N%a==0):
        b = N//a
        f = max(len(str(a)), len(str(b)))
        ans=min(ans,f)
print(ans)

Solution (Python):
import math

N = int(input())
n = int(math.sqrt(N)) + 1
while N % n != 0:
    n -= 1
print(int(math.log10(N/n) + 1))

Solution (Python):
import math

N = int(input())
n = int(math.sqrt(N)) + 1
if N / n == n:
    print(int(math.log10(n) + 1))
else:
    while N % n != 0:
        n -= 1
    print(int(math.log10(N/n) + 1))

Solution (Python):
import math

def order(A, B):
    ord_A = int(math.log10(A) + 1)
    ord_B = int(math.log10(B) + 1)
    return max(ord_A, ord_B)

def solve():
    N = int(input())
    d = 10**12
    i = 1
    while i**2 <= N:
        if N % i == 0:
            d = min(d, order(i, N//i))
        i += 1
        
    print(d)
    
if __name__ == '__main__':
    solve()

Solution (Python):
n=int(input())
def keta(a):
    k=1
    while True:
        if 10**(k-1) <= a <10**k:
            break
        k+=1
    return k
from math import sqrt
f=float("inf")
for i in range(1,int(sqrt(n))+1):
    if n%i==0:
        f=min(f,max(keta(i),keta(n//i)))
print(f)

Solution (Python):
import math


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


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

    i = 1
    minv = 100000000000
    while i <= int(math.sqrt(n)):
        if n%i == 0 and f(i, n//i) < minv:
            minv = f(i, n//i)
        i += 1
    print(minv)
    

if __name__ == "__main__":
    main()

Solution (Python):
import math

N = int(input())
a = int(math.sqrt(N))

ans = [0]*2
for i in reversed(range(1, a+1)):
  if N % i == 0:
    ans[0] = i
    ans[1] = N // i
    break
res = 0
for e in ans:
  now = len(str(e))
  if now > res:
    res = now
    
print(res)

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

Solution (Python):
import math

N = int(input())

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

Solution (Python):
from collections import defaultdict
import math


def main():
    n = int(input())
    ans = float("inf")
    for i in range(1, int(math.sqrt(n)) + 2):
        if n % i == 0:
            ans = min(ans, max(len(str(i)), len(str(n // i))))
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
f = 13
for i in range(1, 1000000):
	if N % i == 0:
		tmp = int(N / i)
		f = min(f ,max(len(str(i)), len(str(tmp))))
		
print(f)

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

Solution (Python):
import math;
 
n = int(input());
a = int(math.sqrt(n));
 
while True:
    b = n // a;
    if n == a * b:
        print(int(math.log10(b))+1);
        break
    a = a-1;

Solution (Python):
import math
N=int(input())
m=int(N**(1/2))
while True:
    if(N%m==0):
        print(int(math.log10(N/m)+1))
        break
    else:
        m-=1
        
        continue

Solution (Python):
import math

n = int(input())
ret = 10000000000000000
for i in range(1, int(math.sqrt(float(n))+5.0)):
    if n % i:
        continue;
    ret = min(ret, max(int(math.log10(n//i)), int(math.log10(i))) + 1)

print(ret)

Solution (Python):
import math

N = int(input())

result_set = []

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

result = pow(10, 10)

for i in result_set:
    result = min(result, int(math.log10(max(i)) + 1))


print(result)

Solution (Python):
import sys




def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


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


n = read_int()
res = 10 ** 20
for a in range(1, n + 1):
    if a * a > n:
        break
    if n % a == 0:
        b = n // a
        f = F(a, b)
        if f < res:
            res = f
print(res)

Solution (Python):
def dig(t):
    res = 0
    
    if t == 0:
        return 1
    
    while t > 0:
        t//=10
        res+=1

    return res

n = int(input())

f = 1000000000

for i in range(n+1):
    if i*i > n: break
    if i <= 0 or n%i > 0: continue
    
    f = min(f, max(dig(i), dig(n//i)))
    
print(f)

Solution (Python):
import math

N = int(raw_input())

sqn = int(math.sqrt(N))
ans = 100

for A in range(1, sqn + 1):
    if N % A == 0:
        B = N / A
        ans = min(ans, max(len(str(A)), len(str(B))))
print ans

Solution (Python):


import sys

N = sys.stdin.readline().replace('\n','')
N = int(N)

def Func(a,b):
	if a > b:
		return digit(a)
	else: return digit(b)
		
def digit(num):
	d = len(str(num))
	return d

ans = 10

for i in range(1,N+1):
	if i*i > N: break
	if N % i == 0:
		dum = Func(N//i,i)
		if ans > dum:
			ans = dum

print(ans)

Solution (Python):

import math
N = int(input())
print(min(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))+1) if N%B == 0])))))

Solution (Python):
import math
def solve():
  N = int(raw_input())
  yaks = []
  for n in range(1, int(math.sqrt(N)) + 1) :
    if(N % n == 0): yaks.append(n)
  
  mind = 999
  for a in yaks:
    b = N / a
    
    d = max(len(str(a)), len(str(b)))
    
    if d < mind :
      mind = d
  return mind

if __name__ == '__main__':
  print solve()

Solution (Python):
import math

N = int(input())
end = math.floor(math.sqrt(N))

count = float('inf')
for i in range(1, end + 1):
    if N % i == 0:
        b = str(int(N / i))
        a = str(i)
        c = max(len(a), len(b))
        count = min(c, count)
    else:
        count = count
print(count)

Solution (Python):
def keta(N):
  return len(str(N))

N=int(input())
A=1
ans=keta(N)
while A*A <= N:
  if N % A == 0:
    B = N // A
    ans=min(ans,keta(B))
  A += 1
print(ans)

Solution (Python):
import math
N=int( input())
for r in range (int(math.sqrt(N)),0,-1):
  if N%r==0:
    count=1
    l=N/r
    for i in range (0,10):
      l=l/10
      if l<1:
        print(count)
        break
      count+=1
    break

Solution (Python):
import math
def run(N):
    for x in range(int(math.sqrt(N))+1, 0, -1):
        if N % x == 0:
            return max(len(str(N/x)), len(str(x)))
print run(int(raw_input()))

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

def keta(r):
    cnt = 0
    while r:
        r//=10
        cnt+=1
    return cnt
ans = 1e10
for i in range (1,1000000000):
    if i * i > n :break
    if n%i !=0 :continue
    ans = min(ans,max(keta(n/i),keta(i)))
print(ans)

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

ans = 1000;
for i in range(1, N+1) :
	if i * i > N :
		break;
	if N % i == 0 : 
		m = N / i;
		ans = min(ans, len(str(m)));
print(ans-2);

Solution (Python):
import math
n = input()
ans = ()
for x in xrange(1, int(math.sqrt(n))+1):
    if n%x<1:
        ans = min(ans, max(len(str(x)), len(str(n/x))))
print ans

Solution (Python):
from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(int(x))))

Solution (Python):
from math import sqrt, log10

n = int(input())
for i in range(int(sqrt(n)), 0, -1):
    if n % i == 0:
        print(int(log10(n // i)) + 1)
        break

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

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

left = mid
while left > 0:
    if not N % left: break
    left -= 1
right = N / left
res = len(str(right))
print res

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

def F(a,b):
    a_digit=len(str(int(a)))
    b_digit=len(str(int(b)))
    if a_digit>b_digit:
        return a_digit
    else:
        return b_digit
min=len(str(N))

for i in range(1,int(N**(0.5))+1):
    if int(N/i)==N/i:
        if F(N/i,i)<min:
            min=F(N/i,i)
            

print(min)

Solution (Python):
import sys
import math

n = int(sys.stdin.readline().strip())

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

ans = 10
i = a
while i > 0:
    if n % i == 0:
        m1 = i
        m2 = int(n/i)

        m = max(m1, m2)
        ord_m = int(math.log10(m) + 1)
        ans = min(ans, ord_m)
    i -= 1

print(ans)

Solution (Python):
N = int(input())
m = list(map(lambda t:max(len(str(t[0])), len(str(t[1]))),[(r,int(N / r)) for r in range(2, int(N ** 0.5) + 2) if N % r == 0]))
print(min(m) if len(m) != 0 else len(str(N)))

Solution (Python):
from math import sqrt

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = int(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N)) + 1) if N % r == 0]))
print(min(m) if len(m) != 0 else len(str(N)))

Solution (Python):
import math

N = int(input())
greater = 0
min_greater = 10**10

a = round(math.sqrt(N)) + 1

for i in range(1, a):
	if  N % i == 0:
		greater = max(N / i, i)
	if greater < min_greater:
		min_greater = greater

ans = int(math.log10(min_greater) + 1)

print(ans)

Solution (Python):
import math

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

N = int(input())
min_d = digits(N)
for i in list(range(2, math.ceil(math.sqrt(N)) + 1, 1)):
    if (N % i == 0):
        min_d = min(max(digits(i),digits(int(N / i))), min_d)
print(min_d)

Solution (Python):
import sys
import math

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

def solve(n):
    ans = 100

    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            a = n / i
            b = n / a
            k = max(get_degit(a), get_degit(b))
            if k < ans:
                ans = k

    return ans

def main():
    n = int(sys.stdin.readline())
    ans = solve(n)

    print(ans)

    return 0

if __name__ == '__main__':
    sys.exit(main())

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

def F(a,b):
    return max(math.floor(math.log10(a)), math.floor(math.log10(b))) + 1

res = 0

for m in range(1, M+1):
    if N % m == 0:
        res = F(m, N//m)

print(res)

Solution (Python):

import numpy as np
import math

N = input()

MinDigit = 10000000001
for i in range(int(math.sqrt(N))+1):
    quotient = 1.0*N/(i+1)
    if(quotient.is_integer() == True):
        
        
        
        if(MinDigit>max(len(str(i+1)),len(str(int(quotient))))):
            MinDigit = max(len(str(i+1)),len(str(int(quotient))))

print(MinDigit)

Solution (Python):

import numpy as np
import math
n = int(input())
res = []
for i in range(int(math.sqrt(n))):
    if n%(i+1) == 0:
        res.append(i+1)
ans = int(math.log10(n/res[-1]) + 1)
print(ans)

Solution (Python):
import math

def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count


N=int(input())
mi=10
for i in range(1,int(N/math.sqrt(N)+1)):
    if N%i==0:
        j=int(N/i)
        if mi>max(keta(i),keta(j)):
            mi=max(keta(i),keta(j))

print(mi)

Solution (Python):
import math

def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count


N=int(input())
mi=10
for i in range(1,int(N/math.sqrt(N)+1)):
    if N%i==0:
        j=int(N/i)
        if mi>max(keta(i),keta(j)):
            mi=max(keta(i),keta(j))

print(mi)

Solution (Python):
import math

n = int(input())

a = 1
for x in range(1, math.floor(math.sqrt(n)) + 1):
  if n % x == 0:
    a = x

b = n / a
res = 1
for i in reversed(range(11)):
  if b >= 10 ** i:
    res = i + 1
    break

print(res)

Solution (Python):
import numpy as np


def numOfDigit(n):
    return int(np.log10(n) + 1)


N = int(input())
M = numOfDigit(N)

for i in range(int(np.sqrt(N)) + 1):
    if N % (i + 1) != 0:
        continue
    N1 = N / (i + 1)
    N2 = i + 1
    M = min(M, numOfDigit(max(N1, N2)))

print(M)

Solution (Python):

import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

def fact(n):
    i = 2
    res = []
    while i*i <= n:
        while n % i == 0:
            res.append(i)
            n /= i
        i += 1
    res.append(n)
    return sorted(res)

def dfs(array, a, b, pos):
    if len(array) == pos:
        return max(len(str(a)), len(str(b)))
    return min(dfs(array, a*array[pos], b, pos + 1), dfs(array, a, b*array[pos], pos + 1))

N = int(raw_input())
f = fact(N)
print dfs(f, 1, 1, 0)

Solution (Python):
import math

if __name__ == "__main__":
    N = int(input())
    n = len(str(N))
    for i in xrange(int(math.sqrt(N)), 1, -1):
        if N % i == 0:
            ii = N/i
            n = max(len(str(i)), len(str(ii)))
            break
    print(n)

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

idx = 1
min_len = float("inf")
while idx * idx <= n:
    if n % idx == 0:
        length = len(str(n/idx))
        if min_len > length:
            min_len = length
    idx += 1
    
print min_len

Solution (Python):
import math

def digits(n):
    if n == 0:
        return 0
    return digits(n/10) + 1

N = int(raw_input())
ans = digits(N)
for d in range(2, int(math.sqrt(N))+1):
    if d*d > N:
        break
    if N % d == 0:
        temp = max(digits(d), digits(N/d))
        if temp < ans:
            ans = temp
print ans

Solution (Python):

import math

N = int(input())


A_list = [int(math.log10(N)+1)]

A = 2

while A * A <= N:
	if N % A == 0:
		A_list.append(int(math.log10(N/A)+1))
	A += 1

print(min(A_list))

Solution (Python):


import math

n = int(raw_input())

i = 1


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

Solution (Python):

num = int(input())

def digit(x):
    point = 0
    while int(x) > 0:
        x /= 10
        point += 1
    return point

def Multi(num):
    y = digit(num)
    A = 1
    while A*A <= num:
        if num%A == 0:
            B = num/A
            C = max(digit(A),digit(B))
            if y > C:
                y = C
        A += 1
    print(y)
Multi(num)

Solution (Python):


import sys
import os
import math


N_str = input().strip()
min_digit = len(N_str)

N = int(N_str)

MAX = int(math.sqrt(N)) + 1
min_digit = float('inf')

for i in range(1, MAX + 1):
    if N % i == 0:
        
        digit0 = len(str(i))
        digit1 = len(str(int(N / i)))
        digit = max(digit0, digit1)
        if digit < min_digit:
            min_digit = digit
print(min_digit)

Solution (Python):
import math

N = int(input())

def enum(N,A):
    if(N % A == 0):
        B = N // A
        return (A,B)
    else:
        return 'NULL'

def F(tupleX):
    t = max(tupleX)
    return int(math.log10(t) + 1)

X = []
hu = int(math.sqrt(N)) + 1
for n in range(1,hu):
    X.append(enum(N,n))

Y = []
for x in X:
    if (x == 'NULL'):
        continue
    else:
        y = F(x)
        Y.append(y)

print(min(Y))

Solution (Python):
import numpy as np
def F(x,y):
    count = 1
    if x<=y:
        while y >= 10:
            y = y/10
            count += 1
        return count
    else :
        while x >= 10:
            x = x/10
            count += 1
        return count

N = input()
min = 10**10
index = np.zeros(2)
for i in range(np.sqrt(N).astype(np.int32)):
    if N%(i+1) == 0:
       if min > F(i+1,N/(i+1)):
           min = F(i+1,N/(i+1))
           index[0] = i+1
           index[1] = N/(i+1)
       

print min

Solution (Python):
def main():
    N = int(input())
    n = int(N**(0.5) + 1)
    while N % n > 0:
        n -= 1
    print(len(str(N // n)))


if __name__ == '__main__':
    main()

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


def func(n):
    return 11 if (N % n > 0) else len(str(N // n))

nn = min(range(1, int(N**(0.5) + 1)), key=func)
ans = len(str(N // nn))

print(ans)

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


def func(n):
    if (N % n > 0):
        return 11
    else:
        
        return len(str(N // n))

nn = min(range(1, int(N**(0.5) + 1)), key=func)
ans = len(str(N // nn))

print(ans)

Solution (Python):
import math

def F(A, B):
    return max(list(map(int, [math.log10(A), math.log10(B)])))+1


def main():
    N = int(input())
    max_ = 0
    for a in range(1, int(math.sqrt(N))+1):
        if N % a != 0:
            continue

        b = N/a
        v = F(a, b)
        if max_ < v:
            max_ = v
    print(v)


if __name__ == '__main__':
    main()

Solution (Python):
import math


def main():
    n = int(input())
    res = f(1, n)
    for i in range(int(math.sqrt(n)), 0, -1):
        if n % i == 0:
            this_f = f(i, n // i)
            if this_f <= res:
                res = this_f
            else:
                break
    print(res)


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


if __name__ == "__main__":
    main()

Solution (Python):
import math


def main():
    n = int(input())
    res = f(1, n)
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            res = min(res, f(i, n // i))
    print(res)


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


if __name__ == "__main__":
    main()

Solution (Python):
import math


def main():
    
    n = int(input())
    res = f(1, n)
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            this_f = f(i, n // i)
            res = this_f if this_f < res else res
        i += 1
    print(res)
    


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


if __name__ == "__main__":
    main()

Solution (Python):
import math
import operator
from itertools import *
from functools import *


def main():
    
    n = int(input())
    res = -1
    divisors_found = set()
    for subset in powerset(prime_factors(n)):
        div1 = prod(subset)
        if div1 not in divisors_found:
            div2 = n // div1
            this_f = f(div1, div2)
            if res == -1 or this_f < res:
                res = this_f
            divisors_found.add(div1)
            divisors_found.add(div2)
    print(res)
    


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


def prime_factors(num):
    factor_list = []
    while num % 2 == 0:
        factor_list.append(2)
        num //= 2
    i = 3
    while i <= math.sqrt(num):
        if num % i == 0:
            factor_list.append(i)
            num //= i
            i = 3
        else:
            i += 2
    if num > 1:
        factor_list.append(num)
    return factor_list


def powerset(iterable):
    s = list(iterable)
    return list(chain.from_iterable(combinations(s, r) for r in range(len(s) + 1)))


def prod(iterable):
    return reduce(operator.mul, iterable, 1)



if __name__ == "__main__":
    main()

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

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

print(ans)

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

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

print(ans)

Solution (Python):
import numpy as np

n = int(input())
max_div = 1
for i in range(1,int(np.sqrt(n))+1):
    if n % i == 0:
        max_div = n//i
ret = len(str(max_div))
print(ret)

Solution (Python):
import math

n = int(input())
f = 10

for a in range(1, int(math.sqrt(n))+1):
    if not n%a==0:
        continue
    b = n//a

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

Solution (Python):
import math

def NumOfDigit(X):
    i=0
    while X>0:
        X//=10
        i+=1
    return i

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

if __name__=="__main__":
    N=int(input())

    A,B=1,1
    now_min=NumOfDigit(N)
    while A<=math.sqrt(N):
        if N%A==0:   
            B=N/A     

            result=F(A,B)
            if result<now_min:
                now_min=result

        A+=1

    print(now_min)

Solution (Python):
import sys,math

N = int(raw_input())
n = int(math.sqrt(N)) + 1
d = None
for x in range(1, n):
	if (N % x == 0): d = x
print len(list(str(N / d)))

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())
a = int(math.sqrt(n))
while n%a != 0: a-=1
print(len(str(n//a)))

Solution (Python):
import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
ans = len(str(n//nn))
print(ans)

Solution (Python):
import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
ans = len(str(n//nn))
print(ans)

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

Solution (Python):


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

Solution (Python):

N = int(input())
minf = 11
for i in range(1,N+1):
    if i**2 > N:
        break
    if N%i == 0:
        j = N/i 
    for k in range(1,12):
        if 10**k > j:
            if k < minf:
                minf = k
            else:
                break
print(minf)

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

for i in xrange(1, N+1):

    if i*i > N:
        break

    if N % i == 0:
        t = i

print len(str(N/t))

Solution (Python):
n = int(input())
i = 1
ans = n

while i * i <= n:
    if n % i == 0:
        b = n // i
        f = len(str(max(ans, b)))
        ans = min(ans, f)

    i += 1

print(ans)

Solution (Python):
import itertools

n = int(input())


def prime_decomposition(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


n_table = prime_decomposition(n)
if not n_table:
    n_table.append(1)
f = 9999


for i in range(len(n_table) + 1):

    i_a = itertools.combinations(n_table, i)

    while True:
        try:
            a = 1
            for j in next(i_a):

                a *= j
            b = int(n / a)

            _f = (len(str(max(a, b))))
        except StopIteration:
            break

        if _f < f:
            f = _f

print(f)

Solution (Python):

import math

num_N = int(input())

min_num = 999999
sqrt_N = math.floor(math.sqrt(num_N))

for i in range(1, sqrt_N + 1):
    if num_N % i == 0:
        len_num_A = len(str(i))
        len_num_B = len(str(int(num_N / i)))
        min_num = min(min_num, max(len_num_A, len_num_B))

print(min_num)

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

for i in xrange(1, N+1):

    if i*i > N:
        break

    elif i*i == N:
        t = i
        break

    if N % i == 0:
        t = i

print len(str(N/t))

Solution (Python):
N = int(raw_input())
t = 1

for i in xrange(1, N):

    if i*i > N:
        break

    elif i*i == N:
        t = i
        break

    if N % i == 0:
        t = i

print len(str(N/t))

Solution (Python):



import math


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


n = int(input())
r, cur = math.floor(math.sqrt(n)), 999999

for i in range(1, r + 1):
    if n % i != 0: continue

    ret = f(i, int(n / i))
    if ret < cur:
        cur = ret

print(cur)

Solution (Python):
from math import sqrt




N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    
    if N%i == 0: 
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)

Solution (Python):

def reduce(N):
    from math import sqrt, ceil
    from copy import deepcopy
    h_reductions = []
    for i in range(ceil(sqrt(N))):
        if N % (i+1) == 0:
            h_reductions.append(i+1)

    reductions = deepcopy(h_reductions)

    if h_reductions[-1]**2 != N:
        for i in range(len(h_reductions)):
            reductions.append(int(N/h_reductions[-1*i - 1]))
    else:
        for i in range(len(h_reductions)-1):
            reductions.append(int(N/h_reductions[-1*i - 2]))
    return reductions

N = int(input())

reductions = reduce(N)

print(len(str(int(reductions[len(reductions)//2]))))

Solution (Python):
import math


def midDivisor(n):
    k = int(math.sqrt(n))
    while n // k * k != n:
        k -= 1
    return k

n = int(input())
print(len(str(n // midDivisor(n))))

Solution (Python):
from math import *


def read(): return list(map(int, input().split()))

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


n = int(input())
ans = 114514
for a in range(1, int(sqrt(n)) + 1):
    if n % a != 0: continue
    b = n // a
    ans = min(ans, f(a, b))

print(ans)

Solution (Python):
N=int(input())
ans=len(str(N))
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())
Nsq = int(math.sqrt(N)) + 1
ans = 10**9

for n in range(1, Nsq):
    if N % n == 0:
        A = n
        B = N // n

        F = max(len(str(B)), len(str(A)))
        ans = min(ans, F)


print(ans)

Solution (Python):
import math

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

    a = int(math.sqrt(N))
    while a >= 1:
        if N % a == 0:
            break
        a -= 1
    b = int(N / a)
    print(len(str(b)))

main()

Solution (Python):

def countDigs(n):
	digs = 0
	while n > 0:
		digs += 1
		n = n // 10
	return digs

















def digs(n):
	for i in range(int((n + 0.1) ** 0.5), 0, -1):
		if n % i == 0:
			print(countDigs(n // i))
			return

digs(int(input()))

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

a = []
b = []

import math

for i in range(1, math.floor(n**0.5) + 1):
    if n%i == 0:
        a.append(i)
        b.append(int(n/i))

a = list(map(str, a))
b = list(map(str, b))


result = []
for i in range(len(a)):
    result.append(max(len(a[i]), len(b[i])))

print(min(result))

Solution (Python):
import math

a = input()
b = int(math.sqrt(a)) + 1
c = 1
mi = 100

for i in range(1, b):
	if a % i == 0:
		d = a / i
	if max(len(str(i)), len(str(d))) < mi:
		mi = max(len(str(i)), len(str(d)))

print mi

Solution (Python):
import math
n=long(raw_input())
a=1
ans=0
while a*a<=n:
	if n%a==0:
		b=n/a
		ans=0
		while b>=1.0:
			ans+=1
			b/=10
	a+=1
print ans

Solution (Python):
import math
n=int(input())
tmp=math.ceil(n**0.5)+1
ans=1000000
for i in range(1,tmp):
    if n%i==0:
        tmp=n//i
        ans=min(ans,len(str(tmp)))

print(ans)

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

def count_digit(N):
    return(len(str(N)))

ans = count_digit(N)

A = 1
while (A * A <= N):
    if N%A != 0: pass
    else:
        B = N//A
        curDig = max(count_digit(A), count_digit(B))
    ans = min(ans, curDig)
    A += 1
print(ans)

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

score = len(str(N))

i = 2
while i ** 2 <= N:
    a, b = divmod(N, i)
    if b == 0:
        score = min(score, len(str(a)))
    i += 1
print(score)

Solution (Python):
import sys, array, re, functools
from math import sqrt, ceil; from itertools import count, islice
input = lambda: sys.stdin.readline()
@functools.lru_cache(maxsize = 10000)



def isPrime(n):
    return n > 1 and all(n%i for i in islice(count(2), int(sqrt(n)-1)))
def f(a, b):
  return  max(len(str(a)), len(str(b)))

def Main():
  N = int(input())
  v = -1
  if isPrime(N):
    print(len(str(N)))
  elif not isPrime(N):
    for i in range(1, ceil(sqrt(N)) + 1):
      if N%i == 0:
        t = f(int(i), int (N/i))
        if v == -1 or v > t:
          v = t
    print(v)
    
if __name__ == '__main__':
  Main()

Solution (Python):
import math

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

n = int(input())
v = -1
for i in range(1, math.ceil(math.sqrt(n)) + 1):
    if n % i == 0:
        t = f(int(i), int(n/i))
        if v == -1 or v > t:
            v = t
print(v)

Solution (Python):
from sys import stdin 
n = int(stdin.readline())
ans = 10**18 
i = 1 
while i*i <=n:
    if n%i==0:
        j = n/i 
        cur = max(len(str(i)) , len(str(j)))
        ans = min(ans,cur)
    i+=1 
print ans

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

r=None
for i in itertools.count(start=1,step=1):
    Q,R=divmod(N,i)
    if i>Q:
        break
    if R == 0:
        digitI = int(math.log10(i) + 1)
        digitQ = int(math.log10(Q) + 1)
        if r==None:
            r = max(digitI,digitQ)
        else:
            r=min(r,max(digitI,digitQ))
print r

Solution (Python):
N = int(raw_input())
t = 1
for i in xrange(1, N):

    if i*i > N:
        break

    elif i*i == N:
        t = i
        break

    if N % i == 0:
        t = i

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