#include <bits/stdc++.h>
using namespace std;
long long a[1000 + 5];
int main() {
  int n, i, j;
  long long ans = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (i = 1; i <= n; i += 2) {
    long long minn = a[i] - 1, sum = a[i];
    for (j = i + 1; j <= n; j++) {
      if (j & 1)
        sum += a[j];
      else {
        long long lx = sum - minn, rx = sum;
        ans += max(min(rx, a[j]) - max(lx, 1ll) + 1, 0ll);
        if (sum < a[j]) break;
        sum -= a[j];
        minn = min(minn, sum);
      }
    }
  }
  printf("%lld\n", ans);
}
