#include <bits/stdc++.h>
using namespace std;
const int maxn = 31;
const int maxm = 301;
const int dir[8][2] = {{1, 0},  {1, -1}, {0, -1}, {-1, -1},
                       {-1, 0}, {-1, 1}, {0, 1},  {1, 1}};
bool vis[maxm][maxm][maxn][8][6], G[maxm][maxm];
int n, t[maxn], ret;
void dfs(int x, int y, int i, int d, int st) {
  if (vis[x][y][i][d][st]) return;
  if (i == n) return;
  vis[x][y][i][d][st] = 1;
  if (!G[x][y]) ret++;
  G[x][y] = 1;
  if (st < t[i])
    dfs(x + dir[d][0], y + dir[d][1], i, d, st + 1);
  else {
    dfs(x, y, i + 1, (d - 1 + 8) % 8, 0);
    dfs(x, y, i + 1, (d + 1) % 8, 0);
  }
}
signed main() {
  while (~scanf("%d", &n)) {
    memset(vis, 0, sizeof(vis));
    memset(G, 0, sizeof(G));
    ret = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d", &t[i]);
    }
    dfs(150, 150, 0, 0, 1);
    printf("%d\n", ret);
  }
  return 0;
}
