#include <bits/stdc++.h>
using namespace std;
int tt[34], n;
int vis[800][800];
int dir[8][2] = {0};
int main() {
  memset(vis, 0, sizeof(vis));
  dir[0][0] = 0;
  dir[1][0] = 1;
  dir[2][0] = 1;
  dir[3][0] = 1;
  dir[4][0] = 0;
  dir[5][0] = -1;
  dir[6][0] = -1;
  dir[7][0] = -1;
  dir[0][1] = 1;
  dir[1][1] = 1;
  dir[2][1] = 0;
  dir[3][1] = -1;
  dir[4][1] = -1;
  dir[5][1] = -1;
  dir[6][1] = 0;
  dir[7][1] = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &tt[i]);
  set<pair<int, pair<int, int> > > S1, S2;
  S1.insert(make_pair(0, make_pair(400, 400)));
  int cnt, d, x, y;
  for (int i = 1; i <= n; i++) {
    cnt = tt[i];
    for (auto it = S1.begin(); it != S1.end(); it++) {
      d = (*it).first;
      x = (*it).second.first;
      y = (*it).second.second;
      cnt = tt[i];
      while (cnt--) {
        x = x + dir[d][0];
        y = y + dir[d][1];
        vis[x][y] = 1;
      }
      S2.insert(make_pair((d + 1) % 8, make_pair(x, y)));
      S2.insert(make_pair((d + 7) % 8, make_pair(x, y)));
    }
    S1 = S2;
    S2.clear();
  }
  int ans = 0;
  for (int i = 0; i < 800; i++)
    for (int j = 0; j < 800; j++) ans += vis[i][j];
  cout << ans << endl;
  return 0;
}
