program main
  implicit none
  integer :: n, i, l, res
  character(10) :: s
  read (*, *) n
  res = 0
  do i = 1, n
    write (s, "(i0)") i
    l = len(trim(s))
    res = res + mod(l, 2)
  end do
  write (*, "(i0)") res
end program main
