module Main where import qualified Data.ByteString.Char8 as BS import Data.Char import Data.String import Data.List import Data.Maybe import Control.Monad main :: IO () main = do [a, b] <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine print $ solve a b solve :: Int -> Int -> Int solve a b | a == b = r - 1 | otherwise = r where r = (a + b) - abs (a - b)