#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &x, T y) {
  return x > y ? x = y, 1 : 0;
}
template <typename T>
inline bool chkmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
template <typename T>
inline void read(T &x) {
  char ch = getchar();
  int f = 1;
  x = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= f;
}
template <typename T, typename... Args>
inline void read(T &x, Args &...args) {
  read(x), read(args...);
}
int n, a[300050];
long long ans;
int main() {
  read(n);
  for (register int i = 1; i <= n; ++i) read(a[i]);
  long long left = 0;
  for (register int i = 1; i <= n; ++i) {
    if (a[i] >= left * 2)
      ans += left, a[i] -= left * 2, left = 0;
    else
      ans += a[i] / 2, left -= a[i] / 2, a[i] = a[i] & 1;
    ans += a[i] / 3, left += a[i] % 3;
  }
  cout << ans << endl;
  return 0;
}
