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: N = int(input())
  
  divList = []
  
  n = N
  
  while n != 1:
      if n % 2 == 0:
          n = n // 2
          divList.append(2)
          continue
      if n % 3 == 0:
          n = n // 3
          divList.append(3)
          continue
  
      newN = n
      isFind = False
      for i in range(6, (n ** (1 / 2)) + 1, 6):
          if n % (i - 1) == 0:
              divList.append(i - 1)
              newN = newN // (i - 1)
              isFind = True
          if n % (i + 1) == 0:
              divList.append(i + 1)
              newN = newN // (i + 1)
              isFind = True
  
          if isFind == True:
              break
  
      if isFind == False:
          divList.append(n)
          newN = 1
      n = newN
  
      # print(divList)
  
  # print(divList)
  
  t = [([1], [1])]
  
  for d in divList:
      newT = []
      for ab in t:
          a, b = ab[0], ab[1]
          a_add = a[:]
          a_add.append(d)
          b_add = b[:]
          b_add.append(d)
  
          newT.append((a, b_add))
          newT.append((a_add, b))
      t = newT
  
  # print(t)
  
  from functools import reduce
  
  a1 = [
      (reduce(lambda a, b: a * b, ab[0]), reduce(lambda a, b: a * b, ab[1])) for ab in t
  ]
  # print(a1)
  
  
  a2 = set([(len(str(ab[0])), len(str(ab[1]))) for ab in a1])
  
  # print(a2)
  
  a3 = [max(ab[0], ab[1]) for ab in a2]
  
  # print(a3)
  
  print(min(a3))
  
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"}]