import Control.Applicative
import Data.List

main :: IO()
main = do
  getLine
  a <- map (read::String->Int) . lines <$> getContents
  print $ (sum $ map (`div`2) a) + (sum $ map ((`subtract` 1) . length) $ filter (elem 1) $ group $ map (`mod`2) a)
