#include <bits/stdc++.h>
using namespace std;
int ans, n, s[505];
bool mark[505][505][33][8], vis[505][505];
int dix[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int diy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void dfs(int x, int y, int rd, int dir) {
  if (mark[x][y][rd][dir] || rd > n) return;
  mark[x][y][rd][dir] = 1;
  int nx = x, ny = y;
  for (int i = 0; i < s[rd]; i++) {
    nx += dix[dir], ny += diy[dir];
    if (!vis[nx][ny]) ans++, vis[nx][ny] = 1;
  }
  dfs(nx, ny, rd + 1, (dir - 1 + 8) % 8);
  dfs(nx, ny, rd + 1, (dir + 1) % 8);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  dfs(250, 250, 1, 0);
  printf("%d\n", ans);
}
