import Control.Applicative
import Data.List

main :: IO()
main = do
  n <- readLn :: IO Int
  as <- map read . lines <$> getContents :: IO [Integer]

  print $ solve as 0

  where
    solve [] _ = 0
    solve (a:as) m = (a+m)`div`2 + solve as (if odd a && m==0 then 1 else 0)
