#include <bits/stdc++.h>
using namespace std;
int n;
set<pair<int, int> > s;
set<pair<int, int> >::iterator it;
vector<pair<int, int> > tv;
int dx[] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
void dfs(int a, int b, int c, int d) {
  int ta;
  scanf("%d", &ta);
  if (a != n) {
    dfs(a + 1, b += dx[d] * ta, c += dy[d] * ta, (d + 1) % 8);
    tv.clear();
    for (it = s.begin(); it != s.end(); it++) tv.push_back(*it);
    for (int e = (0); e < (tv.size()); e++) {
      tv[e].first -= b;
      tv[e].second -= c;
      swap(tv[e].first, tv[e].second);
      tv[e].second = -tv[e].second;
      tv[e].first += b;
      tv[e].second += c;
      s.insert(tv[e]);
    }
    b -= dx[d] * ta, c -= dy[d] * ta;
  }
  for (int e = (1); e <= (ta); e++)
    s.insert(make_pair(b + dx[d] * e, c + dy[d] * e));
}
int main() {
  scanf("%d", &n);
  dfs(1, 0, 0, 0);
  printf("%d\n", s.size());
  return 0;
}
