program digits_in_multiplication
  implicit none
  integer(8) :: n, m, h, l, i
  read(*,*) n
  m = int(ceiling(sqrt(real(n,8))),8)
  h = n/2_8
  l = 0_8
  do i = m, 1_8, -1_8
    if (mod(n,i).eq.0_8) then
      l = n/i
      exit
    end if
  end do
  if (l.eq.0_8) then
    write(*,'(i0)') int(log10(real(n,8))) + 1
  else
    write(*,'(i0)') int(log10(real(l,8))) + 1
  end if
end program digits_in_multiplication