import Data.List
import Data.Char
import Data.Maybe
import qualified Data.ByteString.Char8 as BS8

dig_impl 0 r = r
dig_impl n r = dig_impl (div n 10) (r + 1)

dig n = dig_impl n 0

cnt n
    | dig n <= 1 = n
    | mod (dig n) 2 == 0 = 9 * 10 ^ (dig n - 2) + cnt (n `div` 100)
    | otherwise = n - 10 * cnt (n `div` 10)

main :: IO ()
main = do
    n <- fst . fromJust . BS8.readInteger <$> BS8.getLine

    print $ cnt n
