toInt :: (String -> Int)
toInt x = read x ::Int

getInts = do
  x <- getLine
  let y = (map$toInt)$words x
  return y

getCoin x y n
  | n <= 0 = 0
  | x > y = x + getCoin (x - 1) y (n - 1)
  | otherwise = y + getCoin x (y - 1) (n - 1)

main :: IO ()
main = do
  line <- getLine
  let a = toInt ((words line) !! 0)
      b = toInt ((words line) !! 1)
  print (getCoin a b 2)
