import Control.Monad
main = do
    n <- read <$> getLine
    as <- map read <$> replicateM n getLine
    putStrLn $ show $ solve as

solve :: [Int] -> Int
solve [] = 0
solve (a:[]) = a `div` 2
solve (a:0:cs)  = a `div` 2 + solve cs
solve (a:b:cs)
    | even a    = a `div` 2 + solve (b:cs)
    | otherwise = a `div` 2 + solve (1+b:cs)