#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int maxn = 35, maxc = 400;
bool color[maxc][maxc], vis[maxn][maxc][maxc][10];
int n, ans, t[maxn];
void dfs(int cur, int x, int y, int d) {
  int nx, ny, tx, ty, td;
  vis[cur][x][y][d] = true;
  if (color[x][y] == false) {
    color[x][y] = true;
    ans++;
  }
  nx = x;
  ny = y;
  for (int i = 1; i <= t[cur] - 1; i++) {
    nx += dx[d];
    ny += dy[d];
    if (color[nx][ny] == false) {
      color[nx][ny] = true;
      ans++;
    }
  }
  if (cur == n) {
    return;
  }
  td = (d + 1) % 8;
  tx = nx + dx[td];
  ty = ny + dy[td];
  if (vis[cur + 1][tx][ty][td] == false) {
    dfs(cur + 1, tx, ty, td);
  }
  td = (d + 7) % 8;
  tx = nx + dx[td];
  ty = ny + dy[td];
  if (vis[cur + 1][tx][ty][td] == false) {
    dfs(cur + 1, tx, ty, td);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
  }
  dfs(1, maxc / 2, maxc / 2, 0);
  printf("%d\n", ans);
  return 0;
}
