integer(16) N,ans,i
read*,N
ans=huge(ans)
do i=1,N
  if(i*i>N)exit
  if(mod(N,i)==0)then
    do j=10,0,-1
      if(N/i>=10**j)then
        ans=min(ans,j+1)
        exit
      endif
    end do
  endif
end do
print"(I0)",ans
end