main = do
  [a, b] <- (map read . words) <$> getLine
  putStrLn . show $ solved a b

solved:: Int -> Int -> Int
solved a b
  | mab = div ab 2 + 1
  | otherwise = div ab 2
  where
    ab = a + b
    mab = mod ab 2 /= 0