import Control.Monad rInt :: String -> Int rInt = read pokkyGame l k | l <= k * 2 = 0 -- 一度も齧れない | otherwise = k * kaisuu where kaisuu = l `div` (k * 2) main = do lk <- map rInt . words <$> getLine print $ pokkyGame (lk !! 0) (lk !! 1)