main = do [l,k] <- fmap (map read . words) getLine putStrLn $ show $ div (div (l-1) k) 2 * k