#include <bits/stdc++.h>
using namespace std;
const int N = 350;
const int M = 205;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int mat[N][N][8][32], n, a[N];
int mark[N][N];
int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void dfs(int i, int j, int depth, int dir) {
  if (mat[i][j][dir][depth]) return;
  mat[i][j][dir][depth] = 1;
  for (int k = 0; k <= a[depth + 1]; k++) {
    int nx = i + dx[dir] * k;
    int ny = j + dy[dir] * k;
    if (nx < 0 || ny < 0 || nx > N || ny > N) continue;
    mark[nx][ny] = 1;
    if (k == a[depth + 1]) {
      if (depth + 1 >= n) return;
      int ndir = (dir + 1) % 8;
      dfs(nx, ny, depth + 1, ndir);
      ndir = (dir - 1 + 8) % 8;
      dfs(nx, ny, depth + 1, ndir);
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  a[1]--;
  dfs(160, 160, 0, 0);
  int ans = 0;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      if (mark[i][j]) ans++;
  cout << ans;
  return 0;
}
