#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> dists;
  for (int i = 0; i < n; i++) {
    int dist;
    cin >> dist;
    dists.push_back(dist);
  }
  set<pair<pair<int, int>, pair<int, int>>> frags;
  set<pair<int, int>> locs;
  frags.insert({{0, 0}, {0, dists[0]}});
  vector<pair<int, int>> dirs = {{1, 0},  {1, 1},   {0, 1},  {-1, 1},
                                 {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};
  for (int i = 0; i < n; i++) {
    set<pair<pair<int, int>, pair<int, int>>> newFrags;
    for (pair<pair<int, int>, pair<int, int>> frag : frags) {
      pair<int, int> loc = frag.first;
      pair<int, int> vec = frag.second;
      for (int i = 1; i <= vec.second; i++) {
        int newX = loc.first + dirs[vec.first].first * i;
        int newY = loc.second + dirs[vec.first].second * i;
        locs.insert({newX, newY});
      }
      if (i < n - 1) {
        int newDir = (vec.first + 1) % 8;
        pair<int, int> newLoc = {
            loc.first + dirs[vec.first].first * vec.second,
            loc.second + dirs[vec.first].second * vec.second};
        newFrags.insert({newLoc, {newDir, dists[i + 1]}});
        newDir = (vec.first + 7) % 8;
        newFrags.insert({newLoc, {newDir, dists[i + 1]}});
      }
    }
    frags = newFrags;
  }
  cout << locs.size() << endl;
  return 0;
}
