#include <bits/stdc++.h>
using namespace std;
int dp[320][320][35][8];
int isTravel[320][320];
int t[33];
int n;
int xdir[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int ydir[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int num;
void Dfs(int x, int y, int pos, int dir) {
  num++;
  if (pos == n || dp[x][y][pos][dir]) return;
  dp[x][y][pos][dir] = true;
  for (int i = 0; i < t[pos]; i++) {
    x += xdir[dir];
    y += ydir[dir];
    isTravel[x][y] = true;
  }
  Dfs(x, y, pos + 1, (dir + 1) % 8);
  Dfs(x, y, pos + 1, (dir + 7) % 8);
  return;
}
int main() {
  int i, j;
  int ans = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) cin >> t[i];
  t[0]--;
  memset(isTravel, false, sizeof(isTravel));
  memset(dp, false, sizeof(dp));
  Dfs(160, 160, 0, 0);
  isTravel[160][160] = true;
  for (i = 0; i < 320; i++)
    for (j = 0; j < 320; j++) ans += isTravel[i][j] ? 1 : 0;
  cout << ans << endl;
  return 0;
}
