#include <bits/stdc++.h>
using namespace std;
int X[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int Y[8] = {0, 1, 1, 1, 0, -1, -1, -1};
struct fire {
  int n, di, first, second;
  fire(int _n, int _di, int _x, int _y)
      : n(_n), di(_di), first(_x), second(_y) {}
};
int m[300][300];
int visit[300][300][20];
int main() {
  int n;
  scanf("%d", &n);
  queue<fire> q;
  memset(m, 0, sizeof(m));
  q.push(fire(0, 0, 150, 150));
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    memset(visit, 0, sizeof(visit));
    int aa = 0;
    while (q.front().n == i) {
      fire f = q.front();
      q.pop();
      m[f.first][f.second] = 1;
      for (int j = a - 1; j > 0; j--) {
        f.first += X[f.di];
        f.second += Y[f.di];
        m[f.first][f.second] = 1;
      }
      if (visit[f.first + X[(f.di + 1) % 8]][f.second + Y[(f.di + 1) % 8]]
               [(f.di + 1) % 8] != 1) {
        visit[f.first + X[(f.di + 1) % 8]][f.second + Y[(f.di + 1) % 8]]
             [(f.di + 1) % 8] = 1;
        q.push(fire(f.n + 1, (f.di + 1) % 8, f.first + X[(f.di + 1) % 8],
                    f.second + Y[(f.di + 1) % 8]));
      }
      if (visit[f.first + X[(f.di + 7) % 8]][f.second + Y[(f.di + 7) % 8]]
               [(f.di + 7) % 8] != 1) {
        visit[f.first + X[(f.di + 7) % 8]][f.second + Y[(f.di + 7) % 8]]
             [(f.di + 7) % 8] = 1;
        q.push(fire(f.n + 1, (f.di + 7) % 8, f.first + X[(f.di + 7) % 8],
                    f.second + Y[(f.di + 7) % 8]));
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < 300; i++)
    for (int j = 0; j < 300; j++) {
      ans += m[i][j];
    }
  printf("%d\n", ans);
}
