#include <bits/stdc++.h>
using namespace std;
int a[300010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 != 0) {
      ans += (long long)a[i] / 2;
      a[i] = 1;
    } else {
      ans += (long long)a[i] / 2 - 1;
      a[i] = 2;
    }
  }
  stack<int> s;
  int y = 0;
  while (y < n) {
    if (s.empty()) {
      s.push(a[y]);
    } else {
      if (s.top() == a[y]) {
        s.pop();
        ans += (long long)a[y];
      } else {
        s.push(a[y]);
      }
    }
    y++;
  }
  while (!s.empty()) {
    ans += (long long)s.top() / 2;
    s.pop();
  }
  cout << ans << endl;
  return 0;
}
