import Control.Applicative
import Data.Int

solve :: [Int64] -> Int64
solve [] = 0
solve [x] = 0
solve (x:y:xs) | x == 1 && y == 1 = 1 + solve xs
               | otherwise = solve (y:xs)

main :: IO ()
main = do
    n <- read <$> getLine
    as <- mapM (\_ -> (read :: String -> Int64) <$> getLine) [1..n]
    let res = foldr (\x y -> (x `div` 2) + y) 0 as
        par = solve $ map (`mod` 2) as
    putStrLn . show $ res + par
