#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3fffffff;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, -1, -1, -1, 0, 1, 1, 1};
int n;
int a[100];
bool vis[700][700];
struct node {
  int x, y, d, step, level;
  node(){};
  node(int x, int y, int step, int d, int level)
      : x(x), y(y), step(step), d(d), level(level){};
  bool operator<(const node &ot) const {
    if (x != ot.x) return x < ot.x;
    if (y != ot.y) return y < ot.y;
    if (step != ot.step) return step < ot.step;
    if (d != ot.d) return d < ot.d;
    return level < ot.level;
  }
};
queue<node> q;
set<node> s;
int ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  node t = node(0, 0, 0, 0, 0);
  t.x = 0, t.y = 0, t.d = 0, t.step = a[1], t.level = 1;
  s.insert(t);
  vis[0 + 500][0 + 500] = 1;
  q.push(t);
  while (!q.empty()) {
    t = q.front();
    q.pop();
    if (t.step > 1) {
      int d = t.d;
      t.x += dx[d], t.y += dy[d], vis[t.x + 500][t.y + 500] = 1, t.step--;
      if (s.count(t)) continue;
      q.push(t);
      s.insert(t);
    } else {
      int d = (t.d - 1 >= 0) ? (t.d - 1) : 7,
          d2 = (t.d + 1 <= 7) ? (t.d + 1) : 0;
      int level = t.level + 1;
      if (level > n) continue;
      t.d = d, t.x += dx[d], t.y += dy[d], vis[t.x + 500][t.y + 500] = 1,
      t.step = a[level], t.level = level;
      if (s.count(t) == 0) {
        q.push(t);
        s.insert(t);
      }
      t.d = d2, t.x += dx[d2] - dx[d], t.y += dy[d2] - dy[d],
      vis[t.x + 500][t.y + 500] = 1, t.step = a[level], t.level = level;
      if (s.count(t) == 0) {
        q.push(t);
        s.insert(t);
      }
    }
  }
  ans = 0;
  for (int i = -150; i <= 150; i++)
    for (int j = -150; j <= 150; j++)
      if (vis[i + 500][j + 500]) ans++;
  cout << ans << endl;
  return 0;
}
