#include <bits/stdc++.h>
using namespace std;
int mat[301][301], dir, x, y, t[31], n;
int dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
bool uz[31][301][301][8];
void rec(int dir, int k, int x, int y) {
  if (k > n)
    return;
  else if (!uz[k][x][y][dir]) {
    uz[k][x][y][dir] = 1;
    for (int i = 1; i <= t[k]; i++) {
      x += dx[dir];
      y += dy[dir];
      mat[x][y] = 1;
    }
    rec((dir + 1) % 8, k + 1, x, y);
    rec((dir - 1 + 8) % 8, k + 1, x, y);
  }
}
int main() {
  cin >> n;
  x = 150;
  y = 150;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
  }
  rec(0, 1, 150, 150);
  int rez = 0;
  for (int i = 0; i <= 300; i++) {
    for (int j = 0; j <= 300; j++) {
      rez += mat[i][j];
    }
  }
  cout << rez;
  return 0;
}
