#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int ff = 0x3f3f3f3f;
int mp[302][302];
bool vis[32][302][302][3][3];
int n;
int a[35];
void dfs(int x, int y, int p, int q, int m) {
  if (m == n + 1) return;
  if (vis[m][x][y][p + 1][q + 1]) return;
  vis[m][x][y][p + 1][q + 1] = 1;
  int tx = x, ty = y;
  for (int i = 1; i <= a[m]; i++) {
    tx += p;
    ty += q;
    mp[tx][ty] = 1;
  }
  if (p != 0 && q != 0) {
    dfs(tx, ty, p, 0, m + 1);
    dfs(tx, ty, 0, q, m + 1);
  } else {
    if (p == 0) {
      dfs(tx, ty, 1, q, m + 1);
      dfs(tx, ty, -1, q, m + 1);
    } else {
      dfs(tx, ty, p, 1, m + 1);
      dfs(tx, ty, p, -1, m + 1);
    }
  }
  return;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  dfs(150, 150, -1, 0, 1);
  int ans = 0;
  for (int i = 0; i <= 301; i++)
    for (int j = 0; j <= 301; j++)
      if (mp[i][j] != 0) ans++;
  cout << ans << endl;
  return 0;
}
