program nn
  implicit none
  integer :: N,digi,i
  integer :: alle

  read(*,*) N

  digi=int(log(N*1.0)/log(10.0))+1
  alle=0
!  write(*,*) digi                                                              
  if(mod(digi,2).eq.0) then
     do i=1,digi/2
        alle=alle+9*100**(i-1)
!        write(*,*) alle                                                        
     enddo
  else
    do i=1,digi/2
        alle=alle+9*100**(i-1)
     enddo
     alle=alle+N-(10**(digi-1))+1
  endif

  write(*,'(i0)') int(alle)
end program nn