#include <bits/stdc++.h>
using namespace std;
int vis[305][305], done[305][305][33][8], n, t[33];
int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dr[] = {-1, -1, 0, 1, 1, 1, 0, -1};
void DFS(int c, int r, int idx, int dir) {
  if (idx == n + 1) return;
  if (done[c][r][idx][dir]) return;
  done[c][r][idx][dir] = 1;
  for (int i = 1; i <= t[idx]; i++) {
    vis[c][r] = 1;
    if (i < t[idx]) {
      c += dc[dir];
      r += dr[dir];
    }
  }
  int c1, r1, c2, r2;
  c1 = c + dc[(dir - 1 + 8) % 8];
  r1 = r + dr[(dir - 1 + 8) % 8];
  c2 = c + dc[(dir + 1) % 8];
  r2 = r + dr[(dir + 1) % 8];
  DFS(c1, r1, idx + 1, (dir - 1 + 8) % 8);
  DFS(c2, r2, idx + 1, (dir + 1) % 8);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> t[i];
  memset(done, 0, sizeof(done));
  memset(vis, 0, sizeof(vis));
  DFS(150, 150, 1, 0);
  int ans = 0;
  for (int i = 0; i < 305; i++)
    for (int j = 0; j < 305; j++) ans += vis[i][j];
  cout << ans << endl;
}
