import Control.Applicative
main = do
  n <- read <$> getLine
  let m = head $ filter ((== 0) . (`mod` 4)) [ n - 100 .. ]
  print m