#include <bits/stdc++.h>
using namespace std;
int mp[2][310][310][8];
int vis[310][310];
int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  int n;
  cin >> n;
  vis[150][150] = 1;
  mp[1][150][150][2] = 1;
  for (int u = 1; u <= n; u++) {
    int t;
    cin >> t;
    if (u == 1) t--;
    memset(mp[u & 1 ^ 1], 0, sizeof(mp[u & 1 ^ 1]));
    for (int i = 0; i <= 300; i++)
      for (int j = 0; j <= 300; j++)
        for (int k = 0; k <= 7; k++) {
          if (mp[u & 1][i][j][k]) {
            int di1 = (k + 1) % 8;
            int di2 = (k - 1 + 8) % 8;
            for (int e = 1; e <= t; e++) vis[i + dx[k] * e][j + dy[k] * e] = 1;
            mp[u & 1 ^ 1][i + t * dx[k]][j + t * dy[k]][di1] = 1;
            mp[u & 1 ^ 1][i + t * dx[k]][j + t * dy[k]][di2] = 1;
          }
        }
  }
  int ans = 0;
  for (int i = 0; i <= 300; i++)
    for (int j = 0; j <= 300; j++)
      if (vis[i][j]) ans++;
  cout << ans << endl;
}
