import Control.Applicative
import Data.Int

solve :: [Int64] -> Int64
solve [] = 0
solve [x] = x `div` 2
solve (x:y:xs) | y == 0 = a + solve xs
               | otherwise = b + solve ((y-p):xs)
    where p = x `mod` 2
          a = x `div` 2
          b = (x+p) `div` 2

main :: IO ()
main = do
    n <- read <$> getLine
    as <- mapM (\_ -> (read :: String -> Int64) <$> getLine) [1..n]
    putStrLn . show $ solve as
