#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30 + 3;
const int MAXL = MAXN * 5 + 3;
const int dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          dx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int N, t[MAXN];
bool maze[2 * MAXL][2 * MAXL], used[2 * MAXL][2 * MAXL][8][30];
void dfs(int y, int x, int dir, int deep) {
  for (int i = 1; i <= t[deep]; ++i)
    maze[y + dy[dir] * i][x + dx[dir] * i] = true;
  int ny = y + dy[dir] * t[deep], nx = x + dx[dir] * t[deep];
  if (deep == N - 1) return;
  if (!used[ny][nx][(dir + 1) % 8][deep + 1]) {
    used[ny][nx][(dir + 1) % 8][deep + 1] = true;
    dfs(ny, nx, (dir + 1) % 8, deep + 1);
  }
  if (!used[ny][nx][(dir - 1 + 8) % 8][deep + 1]) {
    used[ny][nx][(dir - 1 + 8) % 8][deep + 1] = true;
    dfs(ny, nx, (dir - 1 + 8) % 8, deep + 1);
  }
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) scanf("%d", &t[i]);
  used[MAXL][MAXL][0][0] = true;
  dfs(MAXL, MAXL, 0, 0);
  int cnt = 0;
  for (int i = 0; i < 2 * MAXL; ++i)
    for (int j = 0; j < 2 * MAXL; ++j)
      if (maze[i][j]) {
        ++cnt;
      }
  printf("%d\n", cnt);
  return 0;
}
