program main
  implicit none
  integer(8) :: N
  integer(8) :: i,j
  integer :: out
  integer :: F
  read(*,*) N
  out = 30
  do i = 1, int ( sqrt(real(N)) )
     if ( mod(N,i) == 0) then
        F = max( digit(i), digit(N/i) )
        if ( out > F) then
           out = F
        end if
     end if
  end do
  write(*,'(i0)') out
  stop
contains
  integer function digit(N)
    integer(8) :: N
    digit = int(log10(real(N))+1)
  end function digit
end program main
