implicit none

integer :: n, m
integer :: i

read *, n

m = 0
do i = 1, n
   if (i < 10) then
      m = m + 1
      cycle
   else if (99 < i .and. i < 1000) then
      m = m + 1
      cycle
   else if (9999 < i .and. i < 100000) then
      m = m + 1
      cycle
   endif
enddo

write(6,'(i0)') m

stop
end