import Data.List
import Data.Char
import Data.Maybe
import qualified Data.ByteString.Char8 as BS8
 
main :: IO ()
main = do
    n <- fst . fromJust . BS8.readInteger <$> BS8.getLine
    let nl = (([1..n] \\ [10..99]) \\ [1000..9999]) \\ [100000..999999]

    print $ length nl
