#include <bits/stdc++.h>
using namespace std;
long long ans, v[1005], n;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> v[i];
  for (long long i = 1; i <= n; i += 2) {
    long long val = v[i];
    long long mini = v[i];
    for (long long j = i + 1; j <= n; j++) {
      if (j % 2 == 0) {
        val -= v[j];
        long long nr1 = max(1LL, v[i] - mini);
        long long nr2 = min(v[i], v[i] - val);
        ans += max(0LL, nr2 - nr1 + 1);
      } else
        val += v[j];
      mini = min(mini, val);
      if (mini < 0) break;
    }
  }
  cout << ans;
  return 0;
}
