#include <bits/stdc++.h>
using namespace std;
const int MOD = 20000;
const int N = 2e6 + 5;
const int K = (1 << 17) + 10;
const long long int INF = 2e18 + 500;
const int inf = 0x7fffffff;
const int SQRT = 500;
const int lgN = 20;
bool dp[403][403][3][3][31][5];
int A[505];
int n;
int vis[1003][1003];
void dfs(int x, int y, int dx, int dy, int level, int left) {
  if (level == n + 1) return;
  bool &memo = dp[x][y][dx + 1][dy + 1][level][left];
  if (memo != false) return;
  left--;
  memo = true;
  vis[x][y] = 1;
  if (left > 0) {
    dfs(x + dx, y + dy, dx, dy, level, left);
    return;
  }
  int ldx, ldy, rdx, rdy;
  if (dy == 0) {
    ldx = rdx = dx;
    ldy = 1, rdy = -1;
  } else if (dx == 0) {
    ldx = -1, rdx = 1;
    ldy = rdy = dy;
  } else if (dx == 1 && dy == 1) {
    ldx = 0, ldy = 1;
    rdx = 1, rdy = 0;
  } else if (dx == -1 && dy == -1) {
    ldx = 0, ldy = -1;
    rdx = -1, rdy = 0;
  } else if (dx == 1 && dy == -1) {
    ldx = 1, ldy = 0;
    rdx = 0, rdy = -1;
  } else if (dx == -1 && dy == 1) {
    ldx = -1, ldy = 0;
    rdx = 0, rdy = 1;
  } else {
    assert(false);
  }
  dfs(x + ldx, y + ldy, ldx, ldy, level + 1, A[level + 1]);
  dfs(x + rdx, y + rdy, rdx, rdy, level + 1, A[level + 1]);
}
int main(int argc, char const *argv[]) {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  memset(dp, false, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
  }
  dfs(200, 201, 0, 1, 1, A[1]);
  int ans = 0;
  for (int i = 0; i <= 1000; i++)
    for (int j = 0; j <= 1000; j++)
      if (vis[i][j]) ans++;
  cout << ans << '\n';
  return 0;
}
