#include <bits/stdc++.h>
using namespace std;
double START_TIME;
void exit() { exit(0); }
template <typename A, typename B>
ostream& operator<<(ostream& os, pair<A, B> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
  for (int i = 0; i <= (int)v.size() - 1; i++) {
    os << v[i] << " ";
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> t) {
  for (auto z : t) {
    os << z << " ";
  }
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
  cerr << endl;
  for (auto z : t) {
    os << "\t" << z.first << " -> " << z.second << endl;
  }
  return os;
}
const int MAX = 3e5 + 41;
int n;
long long ans;
int a[MAX];
void solve() {
  long long q = 0;
  long long r = 0;
  for (int i = 0; i <= n - 1; i++) {
    long long take = (long long)min(a[i] / 2LL, r);
    r -= take;
    a[i] -= (take * 2);
    q += take;
    take = a[i] / 3;
    q += take;
    a[i] -= (take * 3);
    r += a[i];
  }
  printf("%lld\n", q);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= n - 1; i++) {
    scanf("%d", &a[i]);
  }
  solve();
  exit();
  return 0;
}
