fun main() {
    val n = readInt()
    var pairs = 0L
    var rem = 0
    repeat(n) {
        val a = readInt() + rem
        pairs += a/2
        rem = if (a % 2 == 1 && (a > 1 || rem == 0)) 1 else 0
//        println("$a $rem")
    }
    println(pairs)
}

// Input Reader
private fun readLn() = readLine()!!

private fun readInt() = readLn().toInt()