#include <bits/stdc++.h>
using namespace std;
ofstream fout("test.out");
ifstream fin("test.in");
const long long MX = 4e2 + 100, INF = 1e18, INF2 = -1e18, D = 1e9 + 7,
                del = 12641;
long long n, m, arr[MX], cnt, flg, ans;
bool mark[310][310][10][30], mp[MX][MX];
void dfs(long long a, long long b, long long j, long long i) {
  if (mark[a][b][j][i] || i >= n) return;
  mark[a][b][j][i] = 1;
  long long x = a, y = b;
  for (long long k = 0; k < arr[i]; k++) {
    if (j == 0) {
      x--;
      y++;
    }
    if (j == 1) {
      y++;
    }
    if (j == 2) {
      x++;
      y++;
    }
    if (j == 3) {
      x++;
    }
    if (j == 4) {
      x++;
      y--;
    }
    if (j == 5) {
      y--;
    }
    if (j == 6) {
      x--;
      y--;
    }
    if (j == 7) {
      x--;
    }
    mp[x][y] = 1;
  }
  dfs(x, y, (j + 1) % 8, i + 1);
  dfs(x, y, (j + 7) % 8, i + 1);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
  }
  dfs(150, 150, 1, 0);
  for (long long i = 0; i < MX; i++) {
    for (long long j = 0; j < MX; j++) {
      if (mp[i][j]) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
