object Main extends App {

  import scala.io.StdIn.readLine
  val n = readInt()
  var arr = Array.fill(n+1)(0)
  (0 until n) foreach { i =>
    arr(i) = readInt()
  }

  var ans = 0
  (0 until n) foreach { i =>
    if (arr(i) == 0) {
      ()
    } else if (arr(i) <= arr(i+1)) {
      ans = ans + arr(i)
      arr(i) = 0
      arr(i+1) = arr(i+1) - arr(i)
    } else if (arr(i) > arr(i+1)) {
      ans = ans + arr(i+1)
      arr(i) = arr(i) - arr(i+1)
      arr(i+1) = 0
      ans = ans + arr(i) / 2
    }
  }

  println(ans)

}
