import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine

main = do
    argList <- getIntList
    print $ solve argList

solve :: [Integer] -> Integer
solve argList = if aMod > 0 
                then (+) 1 aDiv
                else aDiv
    where
        a1 = head argList
        a2 = last argList
        aDiv = div (a1 + a2) 2
        aMod = mod (a1 + a2) 2