#include <bits/stdc++.h>
const int maxn = 314, gap = 157;
int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int t[50], mp[maxn][maxn], n, res;
bool vis[maxn][maxn][30][8];
void dfs(int x, int y, int deep, int dir) {
  if (vis[x][y][deep][dir]) return;
  vis[x][y][deep][dir] = true;
  for (int i = 1; i <= t[deep]; ++i) {
    x += dx[dir];
    y += dy[dir];
    mp[x][y] = true;
  }
  if (deep == n) return;
  dfs(x, y, deep + 1, (dir + 1) % 8);
  dfs(x, y, deep + 1, (dir + 7) % 8);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &t[i]);
  dfs(gap, gap, 1, 2);
  for (int i = 0; i < maxn; ++i)
    for (int j = 0; j < maxn; ++j)
      if (mp[i][j]) res++;
  printf("%d\n", res);
  return 0;
}
