#include <bits/stdc++.h>
int dr[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
int n, t[30];
bool check[400][400], visited[400][400][30][8];
void bkt(int r, int c, int i, int dir) {
  if (i == n or visited[r][c][i][dir]) return;
  visited[r][c][i][dir] = check[r][c] = true;
  for (int j = 0; j < t[i] - 1; j++) {
    r += dr[dir];
    c += dc[dir];
    check[r][c] = true;
  }
  bkt(r + dr[(dir + 7) % 8], c + dc[(dir + 7) % 8], i + 1, (dir + 7) % 8);
  bkt(r + dr[(dir + 1) % 8], c + dc[(dir + 1) % 8], i + 1, (dir + 1) % 8);
}
int main() {
  while (scanf("%d", &n) > 0) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &t[i]);
    }
    memset(check, false, sizeof check);
    memset(visited, false, sizeof visited);
    bkt(200, 200, 0, 0);
    int ans = 0;
    for (int i = 0; i < 400; i++) {
      for (int j = 0; j < 400; j++) {
        ans += check[i][j];
      }
    }
    printf("%d\n", ans);
  }
}
