output_description: Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive
  integers such that N = A \times B.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
attempt: from collections import defaultdict
  
  n = int(input())
  fact = defaultdict(int)
  fact[1] = 1
  f = 2
  k = n
  while f * f <= min(k * k, n):
      if k % f == 0:
          fact[f] += 1
          k //= f
      else:
          f += 1
  if k > 1:
      fact[k] += 1
  
  
  def digits(n):
      ret = 0
      while n > 0:
          ret += 1
          n //= 10
      return ret
  
  
  def dfs(index, mul, fact):
      if index >= len(fact):
          return max(digits(mul), digits(n // mul))
      k, v = fact[index]
      ret = 10
      for i in range(v + 1):
          ret = min(ret, dfs(index + 1, mul * pow(k, i), fact))
      return ret
  
  
  print(dfs(0, 1, list(fact.items())))
  
problem_description: 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.
samples: [{"input": "10000", "output": "3\n    \n\nF(A,B) has a minimum value of 3 at (A,B)=(100,100).\n\n* * *"}, {"input": "1000003", "output": "7\n    \n\nThere are two pairs (A,B) that satisfy the condition: (1,1000003) and\n(1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.\n\n* * *"}, {"input": "9876543210", "output": "6"}]