#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int D = 151;
int n;
bool F[305][305][305][8];
int G[305][305], ans, t[305], sum[305];
void Print(int x, int y, int dir, int id, int now) {
  if (F[x + D][y + D][now][dir]) return;
  F[x + D][y + D][now][dir] = 1;
  ans += (++G[x + D][y + D]) == 1;
  if (now == sum[id]) {
    if (id == n) return;
    int ld = (dir + 7) % 8, rd = (dir + 1) % 8;
    Print(x + dx[ld], y + dy[ld], ld, id + 1, now + 1);
    Print(x + dx[rd], y + dy[rd], rd, id + 1, now + 1);
  } else
    Print(x + dx[dir], y + dy[dir], dir, id, now + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    sum[i] = sum[i - 1] + t[i];
  }
  Print(0, 0, 1, 1, 1);
  printf("%d\n", ans);
}
