import Control.Monad( replicateM)
main = do
    n <- readLn
    as <- replicateM n readLn
    let (pairs, mods) = unzip $ map (`divMod`2) as
	tie []	= 0
	tie [_]	= 0
	tie [a,b]
	  | a==1 && b==1    = 1
	tie (a:tl@(b:ms))
	  | a==1 && b==1    = 1+tie ms
	  | otherwise	    = tie tl
    print $ (sum pairs) + (tie mods)