#include <bits/stdc++.h>
using namespace std;
int t[100005], mat[305][305], ans = 0, dp[305][305][35][15];
int mx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int my[8] = {1, 1, 0, -1, -1, -1, 0, 1}, n;
void recur(int x, int y, int level, int d) {
  if (level > n || dp[x][y][level][d] != -1) return;
  dp[x][y][level][d] = 1;
  for (int i = 0; i < t[level]; i++) {
    x = x + mx[d];
    y = y + my[d];
    if (mat[x][y] == -1) {
      mat[x][y] = 1;
      ans++;
    }
  }
  recur(x, y, level + 1, (d + 1) % 8);
  recur(x, y, level + 1, (d + 7) % 8);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i];
  for (int i = 0; i < 305; i++)
    for (int j = 0; j < 305; j++) {
      mat[i][j] = -1;
      for (int k = 0; k < 35; k++)
        for (int l = 0; l < 15; l++) dp[i][j][k][l] = -1;
    }
  recur(150, 150, 0, 0);
  cout << ans << endl;
}
