#include <bits/stdc++.h>
using namespace std;
int vis[400][400];
int a[32][320][320][8];
int mx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, my[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  ios::sync_with_stdio(0);
  int n;
  a[0][160][160][0] = 1;
  cin >> n;
  for (auto i = 0; i < n; i++) {
    int t;
    cin >> t;
    for (auto x = 0; x < 320; x++)
      for (auto y = 0; y < 320; y++)
        for (auto k = 0; k < 8; k++) {
          if (a[i][x][y][k]) {
            for (auto h = 0; h < t; h++) {
              vis[x + mx[k] * h][y + my[k] * h] = 1;
            }
            a[i + 1][x + mx[k] * (t - 1) + mx[(k + 1) % 8]]
             [y + my[k] * (t - 1) + my[(k + 1) % 8]][(k + 1) % 8] = 1;
            a[i + 1][x + mx[k] * (t - 1) + mx[(k + 7) % 8]]
             [y + my[k] * (t - 1) + my[(k + 7) % 8]][(k + 7) % 8] = 1;
          }
        }
  }
  int ans = 0;
  for (auto x = 0; x < 320; x++)
    for (auto y = 0; y < 320; y++)
      if (vis[x][y]) ans++;
  cout << ans;
}
