object Main extends App {
  println((for (_ ← 1 to scala.io.StdIn.readInt) yield { scala.io.StdIn.readLong }).toList.foldLeft(0: Long, 0: Long) {
    case ((_, res), 0) ⇒ (0, res)
    case ((0, res), n) ⇒ (n % 2, res + n / 2)
    case ((1, res), n) ⇒ ((n + 1) % 2, res + (n + 1) / 2)
  }._2)
}