#include <bits/stdc++.h>
using namespace std;
struct go {
  bool to[8];
  go() {
    for (int i = 0; i < 8; i++) to[i] = false;
  }
};
vector<vector<vector<go> > > p;
set<pair<int, int> > s;
set<int> tim;
int n, m, ans = 0, t = 0;
vector<int> v;
int main() {
  p.resize(303, vector<vector<go> >(303, vector<go>(2)));
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  cin >> n;
  v.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    tim.insert(t + v[i] - 1);
    t += v[i];
  }
  p[151][151][0].to[1] = true;
  int step = 1, next = 0;
  for (int z = 0; z < t; z++) {
    step ^= 1;
    next ^= 1;
    for (int i = 1; i <= 301; i++)
      for (int j = 1; j <= 301; j++)
        for (int bit = 0; bit < 8; bit++) p[i][j][next].to[bit] = false;
    for (int i = 1; i <= 301; i++) {
      for (int j = 1; j <= 301; j++) {
        for (int bit = 0; bit < 8; bit++) {
          if (p[i][j][step].to[bit]) {
            s.insert({i, j});
            if (tim.find(z) == tim.end()) {
              if (bit == 0) p[i - 1][j + 1][next].to[bit] = true;
              if (bit == 1) p[i][j + 1][next].to[bit] = true;
              if (bit == 2) p[i + 1][j + 1][next].to[bit] = true;
              if (bit == 3) p[i + 1][j][next].to[bit] = true;
              if (bit == 4) p[i + 1][j - 1][next].to[bit] = true;
              if (bit == 5) p[i][j - 1][next].to[bit] = true;
              if (bit == 6) p[i - 1][j - 1][next].to[bit] = true;
              if (bit == 7) p[i - 1][j][next].to[bit] = true;
            } else {
              int bit2 = (bit + 7) % 8;
              int bit3 = (bit + 1) % 8;
              if (bit == 0)
                p[i - 1][j][next].to[bit2] = true,
                      p[i][j + 1][next].to[bit3] = true;
              if (bit == 1)
                p[i - 1][j + 1][next].to[bit2] = true,
                             p[i + 1][j + 1][next].to[bit3] = true;
              if (bit == 2)
                p[i][j + 1][next].to[bit2] = true,
                         p[i + 1][j][next].to[bit3] = true;
              if (bit == 3)
                p[i + 1][j + 1][next].to[bit2] = true,
                             p[i + 1][j - 1][next].to[bit3] = true;
              if (bit == 4)
                p[i + 1][j][next].to[bit2] = true,
                      p[i][j - 1][next].to[bit3] = true;
              if (bit == 5)
                p[i + 1][j - 1][next].to[bit2] = true,
                             p[i - 1][j - 1][next].to[bit3] = true;
              if (bit == 6)
                p[i][j - 1][next].to[bit2] = true,
                         p[i - 1][j][next].to[bit3] = true;
              if (bit == 7)
                p[i - 1][j - 1][next].to[bit2] = true,
                             p[i - 1][j + 1][next].to[bit3] = true;
            }
          }
        }
      }
    }
  }
  cout << s.size() << endl;
  return 0;
}
