main = do
    [a, b] <- map read . words <$> getLine
    putStrLn $ show $ solve a b 0

solve :: Int -> Int -> Int -> Int
solve _ _ 2 = 0
solve x y z = if x > y then x + solve (x - 1) y (z + 1) else y + solve x (y - 1) (z + 1)