#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1}, dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int n, ans, d[110];
int dp[2][410][410][8];
bool vis[410][410];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &d[i]);
  d[1]--;
  memset(dp, -1, sizeof(dp));
  dp[0][200 + dx[0] * d[1]][200][0] = 1;
  for (int i = 0; i <= d[1]; i++) vis[200 + dx[0] * i][200] = 1;
  for (int T = 2, u = 0; T <= n; T++, u ^= 1)
    for (int i = 0; i <= 400; i++)
      for (int j = 0; j <= 400; j++)
        for (int k = 0; k < 8; k++)
          if (dp[u][i][j][k] == T - 1) {
            for (int l = 1; l <= d[T]; l++)
              vis[i + dx[(k + 1) % 8] * l]
                 [j + dy[(k + 1) % 8] * l] = 1,
                                        vis[i + dx[(k + 7) % 8] * l]
                                           [j + dy[(k + 7) % 8] * l] = 1;
            dp[u ^ 1][i + dx[(k + 1) % 8] * d[T]][j + dy[(k + 1) % 8] * d[T]]
              [(k + 1) % 8] = T;
            dp[u ^ 1][i + dx[(k + 7) % 8] * d[T]][j + dy[(k + 7) % 8] * d[T]]
              [(k + 7) % 8] = T;
          }
  for (int i = 0; i <= 400; i++)
    for (int j = 0; j <= 400; j++) ans += vis[i][j];
  printf("%d", ans);
  return 0;
}
