#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
bool used[350][350][8][35], a[350][350];
int t[35], n;
void dfs(int x, int y, int dir, int rec) {
  if (used[x][y][dir][rec]) return;
  used[x][y][dir][rec] = true;
  for (int j = 0; j < t[rec]; j++) {
    x += dx[dir], y += dy[dir];
    a[x][y] = true;
  }
  if (rec != n - 1) {
    dfs(x, y, (dir + 1) % 8, rec + 1);
    dfs(x, y, (dir + 7) % 8, rec + 1);
  }
}
int main() {
  cin >> n;
  int x = 175, y = 175, dir = 0, rec = 0;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
  }
  t[0]--;
  a[x][y] = true;
  dfs(x, y, dir, rec);
  int ans = 0;
  for (int i = 0; i < 350; i++) {
    for (int j = 0; j < 350; j++) {
      if (a[i][j]) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
