#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int INF = 1e9;
const int MOD = INF + 7;
string s;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  long long pairs = 0;
  for (long long i = n - 1; i >= 0; i--) {
    pairs += a[i] / 2;
    if (a[i] % 2 == 1 && pairs > 0) {
      ans += 1;
      pairs -= 1;
    }
  }
  ans += 2 * pairs / 3;
  cout << ans << '\n';
}
