#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e6;
const int NMAX = 500;
const int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
struct pp {
  int first, second, dir, d;
};
pair<int, int> togo[10];
int n, t[50];
int arr[405][405];
bool viz[405][405][35][10];
void dfs(int first, int second, int dir, int tt, int d) {
  if (d == n + 1) return;
  for (int i = 1; i <= tt; ++i) {
    arr[first + i * dx[dir]][second + i * dy[dir]] = 1;
  }
  int x1 = first + tt * dx[dir];
  int y1 = second + tt * dy[dir];
  if (!viz[x1][y1][d + 1][togo[dir].first]) {
    dfs(x1, y1, togo[dir].first, t[d + 1], d + 1);
    viz[x1][y1][d + 1][togo[dir].first] = 1;
  }
  if (!viz[x1][y1][d + 1][togo[dir].second]) {
    dfs(x1, y1, togo[dir].second, t[d + 1], d + 1);
    viz[x1][y1][d + 1][togo[dir].second] = 1;
  }
}
void solve() {
  togo[0] = {7, 1};
  togo[1] = {0, 2};
  togo[2] = {1, 3};
  togo[3] = {2, 4};
  togo[4] = {3, 5};
  togo[5] = {4, 6};
  togo[6] = {5, 7};
  togo[7] = {6, 0};
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> t[i];
  }
  memset(arr, 0, sizeof(arr));
  arr[200][200] = 1;
  dfs(200, 200, 0, t[1] - 1, 1);
  int rs = 0;
  for (int i = 1; i <= 400; ++i)
    for (int j = 1; j <= 400; ++j) rs += arr[i][j];
  cout << rs;
}
int main() {
  cout << setprecision(2) << fixed;
  ;
  time_t tic = clock();
  solve();
  time_t toc = clock();
  return 0;
}
