#include <bits/stdc++.h>
using namespace std;
int modpow(int a, int b, int m) {
  int c = 1;
  while (b) {
    if (b & 1) c = (c * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return c;
}
bool mark[400][400], visi[400][400][8][6][30];
int arr[35], dir[8][2] = {{1, 0}, {0, 1},   {-1, 0}, {0, -1},
                          {1, 1}, {-1, -1}, {1, -1}, {-1, 1}};
int nextDir[8][2] = {{4, 6}, {4, 7}, {5, 7}, {5, 6},
                     {0, 1}, {2, 3}, {0, 3}, {2, 1}},
    n;
void dfs(int x, int y, int dirIndex, int movesLeft, int index) {
  if (visi[x][y][dirIndex][movesLeft][index]) return;
  visi[x][y][dirIndex][movesLeft][index] = 1;
  mark[x][y] = 1;
  if (movesLeft == 1) {
    if (index == n - 1) return;
    for (int i = 0; i < 2; i++) {
      int nextDirIndex = nextDir[dirIndex][i];
      int nextX = x + dir[nextDirIndex][0], nextY = y + dir[nextDirIndex][1];
      dfs(nextX, nextY, nextDirIndex, arr[index + 1], index + 1);
    }
  } else {
    dfs(x + dir[dirIndex][0], y + dir[dirIndex][1], dirIndex, movesLeft - 1,
        index);
  }
}
int main() {
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  dfs(150, 150, 1, arr[0], 0);
  for (int i = 0; i < 400; i++) {
    for (int j = 0; j < 400; j++) {
      if (mark[i][j]) ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
