#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
typedef pair<pair<int, int>, pair<int, int> > P;
double eps = 1e-6;
set<pair<int, int> > exist;
set<P> fire[31];
int t[31];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  P s = P({0, 0}, {0, 1});
  fire[0].insert(s);
  for (int i = 0; i < n; i++) {
    for (auto p : fire[i]) {
      int x = p.first.first, y = p.first.second;
      int dx = p.second.first, dy = p.second.second;
      exist.insert({x, y});
      for (int k = 0; k < t[i] - 1; k++) {
        x += dx, y += dy;
        exist.insert({x, y});
      }
      for (int k = -1; k <= 1; k += 2) {
        double theta = PI / 4.0 * k;
        int ndx = 0, ndy = 0;
        double xx = dx * cos(theta) - dy * sin(theta);
        double yy = dx * sin(theta) + dy * cos(theta);
        if (abs(xx) < eps)
          ndx = 0;
        else if (xx > 0)
          ndx = 1;
        else
          ndx = -1;
        if (abs(yy) < eps)
          ndy = 0;
        else if (yy > 0)
          ndy = 1;
        else
          ndy = -1;
        P ns = P({x + ndx, y + ndy}, {ndx, ndy});
        fire[i + 1].insert(ns);
      }
    }
  }
  cout << exist.size() << endl;
}
