#include <bits/stdc++.h>
using namespace std;
struct firework {
  int x, y, type, dir, dur;
  bool operator<(firework f1) const {
    if (f1.x == x) {
      if (f1.y == y) {
        if (f1.type == type) {
          if (f1.dir == dir) {
            return f1.dur < dur;
          }
          return f1.dir < dir;
        }
        return f1.type < type;
      }
      return f1.y < y;
    }
    return f1.x < x;
  }
};
int d[8][2] = {{0, 1},  {1, 1},   {1, 0},  {1, -1},
               {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};
stack<firework> s;
map<pair<int, int>, bool> h;
map<firework, bool> used;
int timp[35];
int main() {
  int n, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> timp[i];
  }
  s.push({0, 0, 1, 0, 1});
  int ans = 0;
  while (s.empty() == false) {
    firework cur = s.top();
    s.pop();
    if (h[{cur.x, cur.y}] == 0) {
      h[{cur.x, cur.y}] = 1;
      ans++;
    }
    used[cur] = 1;
    if (cur.dur == timp[cur.type]) {
      cur.type++;
      if (cur.type > n) {
        continue;
      }
      cur.dur = 1;
      firework f1, f2;
      f1 = f2 = cur;
      f1.dir--;
      if (f1.dir == -1) {
        f1.dir = 7;
      }
      f1.x += d[f1.dir][0];
      f1.y += d[f1.dir][1];
      if (used[f1] == 0) {
        s.push(f1);
      }
      f2.dir++;
      if (f2.dir == 8) {
        f2.dir = 0;
      }
      f2.x += d[f2.dir][0];
      f2.y += d[f2.dir][1];
      if (used[f2] == 0) {
        s.push(f2);
      }
    } else {
      cur.dur++;
      cur.x += d[cur.dir][0];
      cur.y += d[cur.dir][1];
      if (used[cur] == 0) {
        s.push(cur);
      }
    }
  }
  cout << ans;
  return 0;
}
