      PROGRAM doubleFactorial
      IMPLICIT NONE
      integer(16) :: n
      integer(16) :: div,ans = 0,i,piyo
      
      read*,n
      
      if( mod(n,2)==1 )then
        print*,0
      else
        do i = 18,1,-1
          div = 10**i
          piyo = n / div
          ans = ans + (piyo-1)*i
        end do
        print*,ans
        
      end if
      
      
      
      
      
      END PROGRAM