#include <bits/stdc++.h>
using namespace std;
const int MaxN = 400;
int n, a[50], m[MaxN + 5][MaxN + 5], c[35][9][MaxN + 5][MaxN + 5];
int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0}, dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
void Dfs(int p, int q, int x, int y) {
  if (p > n || c[p][q][x][y]) return;
  c[p][q][x][y] = 1;
  for (int i = 1; i <= a[p]; i++) m[x + dx[q] * i][y + dy[q] * i] = 1;
  Dfs(p + 1, (q + 1) % 8, x + dx[q] * a[p], y + dy[q] * a[p]);
  Dfs(p + 1, (q + 7) % 8, x + dx[q] * a[p], y + dy[q] * a[p]);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  Dfs(1, 1, 200, 200);
  int ans = 0;
  for (int i = 1; i <= 400; i++)
    for (int j = 1; j <= 400; j++)
      if (m[i][j]) ans++;
  printf("%d\n", ans);
}
