#include <bits/stdc++.h>
using namespace std;
long long mnLL(long long a, long long b) { return a < b ? a : b; }
long long mxLL(long long a, long long b) { return a > b ? a : b; }
long long gcd(long long a, long long b) { return a != 0 ? gcd(b % a, a) : b; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long length(long long n) { return n < 10 ? 1 : length(n / 10) + 1; }
void Sin(string& s) {
  char a[50005];
  scanf("%s", &a);
  s = a;
}
int n, t[35], ans;
int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
bool al[30][8][300][300], used[300][300];
void Solve(int x, int y, int dir, int lvl) {
  al[lvl][dir][x][y] = 1;
  for (int i = 0; i < t[lvl]; i++) used[x + i * dx[dir]][y + i * dy[dir]] = 1;
  if (lvl == n - 1) return;
  x += (t[lvl] - 1) * dx[dir];
  y += (t[lvl] - 1) * dy[dir];
  if (!al[lvl + 1][(dir + 1) % 8][x + dx[(dir + 1) % 8]][y + dy[(dir + 1) % 8]])
    Solve(x + dx[(dir + 1) % 8], y + dy[(dir + 1) % 8], (dir + 1) % 8, lvl + 1);
  if (!al[lvl + 1][(dir + 7) % 8][x + dx[(dir + 7) % 8]][y + dy[(dir + 7) % 8]])
    Solve(x + dx[(dir + 7) % 8], y + dy[(dir + 7) % 8], (dir + 7) % 8, lvl + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &t[i]);
  Solve(150, 150, 0, 0);
  for (int i = 0; i < 300; i++)
    for (int j = 0; j < 300; j++) ans += used[i][j];
  cout << ans << endl;
  return 0;
}
