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: def 解():
      iN = int(input())
      iLim = int(iN**0.5) + 1
      iNN = iN
  
      # とりあえず篩ながら素因数集める
      dS = {}
      aS = list(range(iLim + 1))
      for i in range(2, iLim + 1):
          if aS[i]:
              if iNN % i == 0:
                  dS[i] = 0
                  while iNN % i == 0:
                      dS[i] += 1
                      iNN //= i
              if iNN == 1:
                  break
              for j in range(i * 2, iLim + 1, i):
                  aS[j] = 0
      if 1 < iNN:
          print(len(str(iNN)))
          exit()
  
      # 半分にわけて余りをdSに集める
      iD = 1
      for i in dS.copy():
          if dS[i] % 2 == 0:
              iD *= i ** (dS[i] // 2)
              del dS[i]
          else:
              if 1 < dS[i]:
                  iD *= i ** (dS[i] // 2)
              dS[i] = 1
      if len(dS) == 0:
          print(len(str(iD)))
      elif len(dS) == 1:
          print(len(str(iD * list(dS.keys())[0])))
      else:
          aS = sorted(list(dS.keys()))
          n = len(aS)
          iPr1 = aS[0]
          for i in range(1, n - 1):
              iPr1 *= aS[i]
          iMinMax = max(iPr1, aS[-1])
          # 余りの素因数が多いと無理だがこれで通るかな？
          for i in range(0, n - 1):
              iA = aS[i] * aS[-1]
              iB = 1
              for j in range(1, n - 1):
                  if j != i:
                      iB *= aS[j]
              iMinMax = min(iMinMax, max(iA, iB))
          print(len(str(iD * iMinMax)))
  
  
  解()
  
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"}]