#include <bits/stdc++.h>
using namespace std;
bool dp[2][8][310][310];
bool res[310][310];
int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
int main() {
  dp[0][0][150][150] = 1;
  int n;
  int t[33];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i];
  for (int i = 0; i < n; i++) {
    int k = i % 2;
    memset(dp[k ^ 1], 0, sizeof(dp[k ^ 1]));
    for (int d = 0; d < 8; d++) {
      for (int x = 0; x < 310; x++) {
        for (int y = 0; y < 310; y++) {
          if (dp[k][d][x][y]) {
            for (int j = 0; j < t[i]; j++) {
              int new_x = x + dx[d] * j;
              int new_y = y + dy[d] * j;
              res[new_x][new_y] = 1;
            }
            int fx = x + dx[d] * (t[i] - 1);
            int fy = y + dy[d] * (t[i] - 1);
            {
              int new_d = (d + 1) % 8;
              int new_x = fx + dx[new_d];
              int new_y = fy + dy[new_d];
              dp[k ^ 1][new_d][new_x][new_y] = 1;
            }
            {
              int new_d = (d + 7) % 8;
              int new_x = fx + dx[new_d];
              int new_y = fy + dy[new_d];
              dp[k ^ 1][new_d][new_x][new_y] = 1;
            }
          }
        }
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < 310; i++) {
    for (int j = 0; j < 310; j++) {
      if (res[i][j]) cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
