import java.io.PrintWriter
object out : PrintWriter(System.out)

fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    var dp0 = 0L
    var dp1 = -1L
    for (i in 1..n) {
        val a = readLine()!!.toInt()
        val ndp0 = Math.max(dp0 + a / 2, dp1 + (a + 1) / 2)
        val ndp1 = if (a == 0) -1L else Math.max(dp0 + (a - 1) / 2, dp1 + a / 2)
        dp0 = ndp0
        dp1 = ndp1
    }
    out.println(Math.max(dp0, dp1))
    out.close()
}