import Control.Applicative ((<$>)) main :: IO () main = do solve <$> read <$> getLine >>= print solve :: Int -> Int solve = (2017 -)