      module piyoMod
      implicit none
      
      contains
      function digit( n )
        implicit none
        integer :: n,digit
        integer :: i,ten
        
        i = 1
        do while( .true. )
          ten = 10**i
          if( n/ten==0 )then
            digit = i
            return
          else
            i = i + 1
          end if
        end do
      end function
      
      end module
      
      
      program main
      use piyoMod
      implicit none
      integer :: n,i,ans=0
      read*,n
      
      do i = 1,n
        if(mod(digit(i),2)==1)then
          ans = ans + 1
        end if
      end do
      
      print*,ans
      
      end program