
import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val ans = (1 to n).map(_ => sc.nextInt)
    .foldLeft(0, 0) {
      case ((cnt, o), a) => (cnt + (a + o) / 2, if (a == 0) 0 else (a + o) % 2)
    }

  println(ans._1)
}
