#include <bits/stdc++.h>
using namespace std;
int n, ans, a[35];
bool v[305][305], v2[305][305][305][8];
int dx[8] = {0, -1, -1, -1, 0, 1, 1, 1}, dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
struct qaq {
  int x, y, lay, dir;
};
queue<qaq> q;
void bfs() {
  q.push((qaq){152, 152, 1, 2});
  while (!q.empty()) {
    qaq tmp = q.front();
    q.pop();
    if (v2[tmp.x][tmp.y][tmp.lay][tmp.dir]) continue;
    if (tmp.lay > n) continue;
    v2[tmp.x][tmp.y][tmp.lay][tmp.dir] = 1;
    for (int i = 1; i <= a[tmp.lay]; i++) {
      v[tmp.x + dx[tmp.dir]][tmp.y + dy[tmp.dir]] = 1;
      tmp.x += dx[tmp.dir];
      tmp.y += dy[tmp.dir];
    }
    q.push((qaq){tmp.x, tmp.y, tmp.lay + 1, (tmp.dir + 1) % 8});
    q.push((qaq){tmp.x, tmp.y, tmp.lay + 1, (tmp.dir + 7) % 8});
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  bfs();
  for (int i = 1; i <= 300; i++)
    for (int j = 1; j <= 300; j++)
      if (v[i][j]) ans++;
  cout << ans;
  return 0;
}
