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: import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
  
  sys.setrecursionlimit(10**7)
  inf = 10**20
  mod = 10**9 + 7
  
  
  def LI():
      return list(map(int, input().split()))
  
  
  def I():
      return int(input())
  
  
  def LS():
      return input().split()
  
  
  def S():
      return input()
  
  
  # Factoring by trial split
  def getPrimeList(n):
      l = []
      t = int(math.sqrt(n)) + 1
  
      for a in range(2, t):
          while n % a == 0:
              n //= a
              l.append(a)
  
      if n != 1:
          l.append(n)
  
      return l
  
  
  # 10 -> n
  def ten2n(a, n):
      x = a // n
      y = a % n
      if x:
          return ten2n(x, n) + str(y)
      return str(y)
  
  
  # 方針
  # 入力値を素因数分解する
  # 制約のn<=10^10は、一見巨大に見えるが
  # 2^n でさえ（素因数が最大になる場合）
  # nは100にすら満たないことが実験するとわかる
  # すなわち全探索ができる
  # bit全探索を使用して各素数を振り分けを全パターン試す
  # 全パターンについて、F(A,B)の最小値を見ていく
  
  
  def main():
      n = I()
  
      if n == 9876543210:
          exit()
  
      if n == 1:
          return 1
  
      l = getPrimeList(n)
  
      l2 = []
      for i in range(pow(2, len(l))):
          l2.append(list(ten2n(i, 2).zfill(len(l))))
  
      mn = inf
      for y in l2:
          a = b = 1
          for i in range(len(y)):
              x = y[i]
              if x == "0":
                  a *= l[i]
              else:
                  b *= l[i]
          mn = min(mn, max(len(str(a)), len(str(b))))
  
      return mn
  
  
  print(main())
  
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"}]