#include <bits/stdc++.h>
using namespace std;
int n, x = 0;

int main() {
    cin >> n;
    long long res = 0;
    for (int i = 1; i <= n; i++) {
        int a; scanf("%d", &a);
        x += a;
        res += x/2;
        if (a == 0) x = 0;
        else x %= 2;
    }
    cout << res << endl;
}
