#include <bits/stdc++.h>
using namespace std;
bool vis[400][400], dp[400][400][31][9];
vector<long long> vect;
long long n;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
void trav(long long x, long long y, long long lev, long long dir) {
  if (lev >= n || dp[x][y][lev][dir] == true) {
    return;
  }
  dp[x][y][lev][dir] = true;
  for (int i = 0; i < vect[lev]; i++) {
    x += dx[dir];
    y += dy[dir];
    vis[x][y] = true;
  }
  trav(x, y, lev + 1, (dir + 1) % 8);
  trav(x, y, lev + 1, (dir + 7) % 8);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    long long tmp;
    cin >> tmp;
    vect.push_back(tmp);
  }
  long long cnt = 0, val = 0;
  memset(vis, false, sizeof(vis));
  ;
  memset(dp, false, sizeof(dp));
  ;
  trav(151, 151, 0, 2);
  for (int i = 0; i <= 302; i++) {
    for (int j = 0; j < 302; j++) {
      if (vis[i][j] == true) cnt++;
    }
  }
  for (int j = 0; j < 300; j++) {
    if (vis[0][j] == true) {
      val++;
    }
  }
  long long ans = cnt;
  cout << ans << endl;
  return 0;
}
