-- ABC124 A problem
import Control.Monad

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

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

maxGain :: Int -> Int -> Int
maxGain m n =
  if m - n >= 2 then 2*m - 1
  else
    if m >= n then m + n
    else maxGain n m

main :: IO ()
main = do
  x <- getInts
  let a = head x :: Int
  let b = last x :: Int
  print (maxGain a b)