#include <bits/stdc++.h>
using namespace std;
const int MAXN = 350;
int a[MAXN][MAXN][9], a_new[MAXN][MAXN][9];
bool ever[MAXN][MAXN];
int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  int n;
  scanf("%d", &n);
  a[MAXN / 2 + 1][MAXN / 2][0] = 1;
  while (n--) {
    int x;
    scanf("%d", &x);
    while (x--) {
      memset(a_new, 0, sizeof(a_new));
      for (int i = 0; i < MAXN; ++i) {
        for (int j = 0; j < MAXN; ++j) {
          for (int d = 0; d < 8; ++d) {
            if (a[i][j][d]) {
              int xn = i + dx[d];
              int yn = j + dy[d];
              if (xn >= 0 && yn >= 0 && xn < MAXN && yn < MAXN)
                a_new[xn][yn][d] = 1;
            }
          }
        }
      }
      for (int i = 0; i < MAXN; ++i) {
        for (int j = 0; j < MAXN; ++j) {
          for (int d = 0; d < 8; ++d) {
            a[i][j][d] = a_new[i][j][d];
            ever[i][j] |= a[i][j][d];
          }
        }
      }
    }
    memset(a_new, 0, sizeof(a_new));
    for (int i = 0; i < MAXN; ++i) {
      for (int j = 0; j < MAXN; ++j) {
        for (int d = 0; d < 8; ++d) {
          if (a[i][j][d]) {
            a_new[i][j][(d + 1) % 8] = 1;
            a_new[i][j][(d + 7) % 8] = 1;
          }
        }
      }
    }
    for (int i = 0; i < MAXN; i++) {
      for (int j = 0; j < MAXN; ++j) {
        for (int d = 0; d < 8; ++d) {
          a[i][j][d] = a_new[i][j][d];
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < MAXN; ++i) {
    for (int j = 0; j < MAXN; ++j) {
      if (ever[i][j]) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
