program ABC136B
    implicit none
    integer::N,i,digits,j,ans=0
    read*,N
    do i=1,N
        j=i
        digits=1
        do
            if(j/10==0)exit
            j=j/10
            digits=digits+1
        end do
        if(mod(digits,2)==1)ans=ans+1
    end do
    print'(i0)',ans
end program ABC136B