PROGRAM main
  implicit none
  integer(8) :: N
  integer(8) :: i, j
  
  read *, N
  
  do i = int(sqrt(dble(N))), N,4
    j = i
    if(mod(N,j) == 0)then
      print "(i0)", max(int(log10(dble(j))), int(log10(dble(N/j))))+1
      exit
    endif
    j = i + 1
    if(mod(N,j) == 0)then
      print "(i0)", max(int(log10(dble(j))), int(log10(dble(N/j))))+1
      exit
    endif
    j = i + 2
    if(mod(N,j) == 0)then
      print "(i0)", max(int(log10(dble(j))), int(log10(dble(N/j))))+1
      exit
    endif
    j = i + 3
    if(mod(N,j) == 0)then
      print "(i0)", max(int(log10(dble(j))), int(log10(dble(N/j))))+1
      exit
    endif
  enddo

END PROGRAM main