#include <bits/stdc++.h>
using namespace std;
int n, x, ans;
bool grid[400][400], save[340][340][30][5][8];
vector<int> a;
int dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
void solve(int x, int y, int ind, int level, int dir) {
  if (ind == (int)(a.size())) return;
  if (save[x][y][ind][level][dir]) return;
  save[x][y][ind][level][dir] = 1;
  grid[x][y] = 1;
  if (level == a[ind]) {
    solve(x + dx[(dir + 1) % 8], y + dy[(dir + 1) % 8], ind + 1, 1,
          (dir + 1) % 8);
    solve(x + dx[(dir + 7) % 8], y + dy[(dir + 7) % 8], ind + 1, 1,
          (dir + 7) % 8);
  } else
    solve(x + dx[dir], y + dy[dir], ind, level + 1, dir);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  while (n-- && cin >> x) a.push_back(x);
  solve(200, 200, 0, 1, 0);
  for (int i = 0; i < 400; i++)
    for (int j = 0; j < 400; j++) ans += grid[i][j];
  cout << ans << endl;
  return 0;
}
