#include <bits/stdc++.h>
using namespace std;
const int me = 625;
int N, answer, all;
int t[me];
char used[me][me];
int gone[me][me][9];
int ans;
int dx[] = {0, 0, 1, 1, 1, 0, -1, -1, -1};
int dy[] = {0, 1, 1, 0, -1, -1, -1, 0, 1};
int l[] = {0, 2, 1, 2, 3, 4, 5, 6, 7};
int r[] = {0, 8, 3, 4, 5, 6, 7, 8, 1};
void go(int x, int y, int step, int direction) {
  if (step > N || answer >= all) {
    return;
  }
  if (t[step] < gone[x][y][direction]) return;
  gone[x][y][direction] = t[step];
  for (int i = 1; i <= t[step]; i++) {
    x += dx[direction];
    y += dy[direction];
    if (!used[x][y]) {
      answer++;
      used[x][y] = 1;
    }
  }
  go(x, y, step + 1, l[direction]);
  go(x, y, step + 1, r[direction]);
}
bool dp[31][320][320][9], used2[320][320];
int offset = 155;
void solve2() {
  for (int i = 1; i <= t[1]; i++) {
    dp[1][offset][offset + i][1] = 1;
    used2[offset][offset + i] = 1;
  }
  int xx = offset;
  int yy = offset + t[1];
  dp[2][xx - t[2]][yy + t[2]][8] = 1;
  dp[2][xx + t[2]][yy + t[2]][2] = 1;
  for (int i = 1; i <= t[2]; i++) {
    used2[xx - i][yy + i] = 1;
    used2[xx + i][yy + i] = 1;
  }
  for (int i = 3; i <= N; i++)
    for (int j = 1; j < 320; j++)
      for (int k = 1; k < 320; k++)
        for (int q = 1; q < 9; q++) {
          dp[i][j][k][q] |= dp[i - 1][j - dx[q] * t[i]][k - dy[q] * t[i]][l[q]];
          dp[i][j][k][q] |= dp[i - 1][j - dx[q] * t[i]][k - dy[q] * t[i]][r[q]];
          for (int ll = 1; ll <= t[i]; ll++) {
            used2[j][k] |= dp[i - 1][j - dx[q] * ll][k - dy[q] * ll][l[q]];
            used2[j][k] |= dp[i - 1][j - dx[q] * ll][k - dy[q] * ll][r[q]];
          }
        }
  ans = 0;
  for (int i = 1; i < 320; i++)
    for (int j = 1; j < 320; j++) ans += used2[i][j];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> t[i];
  for (int i = 2; i <= N; i++) all += t[i];
  all = 2 * all + 1;
  all *= all;
  if (N == 1) {
    cout << t[1] << endl;
    return 0;
  }
  solve2();
  cout << ans << endl;
  return 0;
}
