#include <bits/stdc++.h>
using namespace std;
vector<int> v;
bool grid[310][310];
bool vis[310][310][8];
pair<int, int> inc[8];
pair<int, int> change[8];
int main() {
  inc[0] = {1, 0};
  inc[3] = {-1, 0};
  inc[6] = {0, -1};
  inc[7] = {0, 1};
  inc[1] = {1, 1};
  inc[2] = {1, -1};
  inc[4] = {-1, 1};
  inc[5] = {-1, -1};
  change[0] = {1, 2};
  change[3] = {4, 5};
  change[6] = {2, 5};
  change[7] = {1, 4};
  change[1] = {0, 7};
  change[2] = {0, 6};
  change[4] = {3, 7};
  change[5] = {3, 6};
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    v.push_back(x);
  }
  queue<pair<pair<int, int>, int> > q[2];
  q[0].push(make_pair(make_pair(152, 152), 0));
  for (int i = 0; i < n; i++) {
    int idx = i % 2;
    memset(vis, 0, sizeof(vis));
    while (!q[idx].empty()) {
      int x = q[idx].front().first.first;
      int y = q[idx].front().first.second;
      int dx = inc[q[idx].front().second].first;
      int dy = inc[q[idx].front().second].second;
      int type = q[idx].front().second;
      q[idx].pop();
      int aux = v[i];
      while (aux--) {
        grid[x][y] = true;
        if (aux == 0) {
          int type1 = change[type].first;
          int type2 = change[type].second;
          pair<int, int> coord1 =
              make_pair(x + inc[type1].first, y + inc[type1].second);
          pair<int, int> coord2 =
              make_pair(x + inc[type2].first, y + inc[type2].second);
          if (!vis[coord1.first][coord1.second][type1]) {
            vis[coord1.first][coord1.second][type1] = true;
            q[(idx + 1) % 2].push(make_pair(coord1, type1));
          }
          if (!vis[coord2.first][coord2.second][type2]) {
            vis[coord2.first][coord2.second][type2] = true;
            q[(idx + 1) % 2].push(make_pair(coord2, type2));
          }
        } else {
          x += dx;
          y += dy;
        }
      }
    }
  }
  int r = 0;
  for (int i = 0; i < 310; i++) {
    for (int j = 0; j < 310; j++) {
      if (grid[i][j]) r++;
    }
  }
  printf("%d\n", r);
  return 0;
}
