#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n;
vector<int> t;
vector<vector<bool>> rec(int level) {
  vector<vector<bool>> points(10 * n + 1, vector<bool>(10 * n + 1, false));
  if (level == n) return points;
  vector<vector<bool>> prevp = rec(level + 2);
  for (int y = 1; y <= t[level]; y++) points[5 * n][5 * n + y] = true;
  for (int k = 1; k <= t[level + 1]; k++) {
    points[5 * n + k][5 * n + k + t[level]] =
        points[5 * n - k][5 * n + k + t[level]] = true;
  }
  for (int x = 0; x < prevp.size(); x++) {
    for (int y = 0; y < prevp[x].size(); y++) {
      if (prevp[x][y]) {
        int xx = x - 5 * n, yy = y - 5 * n;
        points[5 * n + t[level + 1] + xx]
              [5 * n + t[level] + t[level + 1] + yy] = true;
        points[5 * n - t[level + 1] + xx]
              [5 * n + t[level] + t[level + 1] + yy] = true;
        points[5 * n + t[level + 1] + yy]
              [5 * n + t[level] + t[level + 1] + xx] = true;
        points[5 * n - t[level + 1] - yy]
              [5 * n + t[level] + t[level + 1] + xx] = true;
      }
    }
  }
  return points;
}
void Solve() {
  scanf("%d", &n);
  t.resize(n);
  for (int i = 0; i < n; i++) scanf("%d", &t[i]);
  if (n % 2 == 1) n++, t.push_back(0);
  vector<vector<bool>> points = rec(0);
  int counter = 0;
  for (int i = 0; i < points.size(); i++)
    for (int j = 0; j < points[i].size(); j++) counter += points[i][j];
  printf("%d", counter);
}
int main() {
  Solve();
  return 0;
}
