fun main(args: Array<String>) {
    agc003b()
}

fun agc003b() {
    val n = readLine()!!.toInt()
    val aList = (1..n).map { readLine()!!.toLong() }.toLongArray()

    var answer = 0L

    var before = 0L
    for (a in aList) {
        val curr = before + a
        answer += curr / 2
        before = if (a > 0) curr % 2 else 0
    }

    println(answer)
}
