#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
long long n, all, a[300100], x[300100], top;
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n, all;
  for (int i = 0; i < n; i++) {
    cin >> a[i], all += a[i];
    if (!top && a[i] % 2 == 1) {
      x[top++] = a[i];
    } else if (top && (x[top - 1] + a[i]) % 2 == 1) {
      x[top++] = a[i];
    } else if (top) {
      top--;
    }
  }
  cout << (all - (top + 1) / 2) / 2 << '\n';
}
