check :: Int -> Int -> Bool
check m n
    | (mod n 2 == 0) && (mod n m == 0) = True
    | otherwise = False

main :: IO ()
main = do
    m <- readLn
    putStrLn $ show $ head $ filter (check m) [1..1000000000]