#include <bits/stdc++.h>
using namespace std;
const double sn = 1e-6;
int n;
int arr[35];
int res;
bool visited[310][310];
bool notAgain[310][310][35][8];
pair<int, int> dirs[8] = {{0, 1},  {1, 1},   {1, 0},  {1, -1},
                          {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};
void dfs(int dir, int sx, int sy, int sc) {
  if (notAgain[sx][sy][sc][dir]) return;
  notAgain[sx][sy][sc][dir] = true;
  for (int i = 0; i < arr[sc]; i++) {
    sx += dirs[dir].first;
    sy += dirs[dir].second;
    if (!visited[sx][sy]) {
      visited[sx][sy] = true;
      res++;
    }
  }
  if (sc < n - 1) {
    dfs(dir != 7 ? dir + 1 : 0, sx, sy, sc + 1);
    dfs(dir != 0 ? dir - 1 : 7, sx, sy, sc + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  dfs(0, 155, 155, 0);
  printf("%d\n", res);
  return 0;
}
