#include <bits/stdc++.h>
using namespace std;
class DebugStream {
} LOG;
template <typename T>
DebugStream &operator<<(DebugStream &s, const T &) {
  return s;
}
mt19937 rnd(time(NULL));
const int maxN = 3e5 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20,
          bs = 29;
long long arr[maxN], ans;
int n;
long long F(long long n) { return n * (n + 1) / 2; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int hei = 0;
  for (int i = n - 1; i >= 0; i--) {
    long long prof = (arr[i] - hei) / 2;
    ans += prof, arr[i] -= prof * 2;
    if (hei && arr[i] == hei)
      ans += hei, hei--;
    else
      hei = arr[i];
  }
  long long tmp = F(hei / 2) * 2;
  ans += min(F(hei) - tmp, tmp);
  cout << ans << '\n';
}
