#include <bits/stdc++.h>
using namespace std;
int dp[310][310][35];
int t[35];
int main() {
  int n;
  scanf("%d ", &n);
  ;
  for (int i = 0; i < n; i++) scanf("%d ", &t[i]);
  ;
  dp[150][150][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 310; j++)
      for (int k = 0; k < 310; k++) {
        if (!(dp[j][k][i] & 15)) continue;
        if (i % 2) {
          if (dp[j][k][i] & 1) {
            for (int l = 1; l < t[i]; l++) dp[j + l][k + l][i + 1] |= 16;
            dp[j + t[i]][k + t[i]][i + 1] |= 9;
          }
          if (dp[j][k][i] & 2) {
            for (int l = 1; l < t[i]; l++) dp[j + l][k - l][i + 1] |= 16;
            dp[j + t[i]][k - t[i]][i + 1] |= 3;
          }
          if (dp[j][k][i] & 4) {
            for (int l = 1; l < t[i]; l++) dp[j - l][k - l][i + 1] |= 16;
            dp[j - t[i]][k - t[i]][i + 1] |= 6;
          }
          if (dp[j][k][i] & 8) {
            for (int l = 1; l < t[i]; l++) dp[j - l][k + l][i + 1] |= 16;
            dp[j - t[i]][k + t[i]][i + 1] |= 12;
          }
        } else {
          if (dp[j][k][i] & 1) {
            for (int l = 1; l < t[i]; l++) dp[j + l][k][i + 1] |= 16;
            dp[j + t[i]][k][i + 1] |= 3;
          }
          if (dp[j][k][i] & 2) {
            for (int l = 1; l < t[i]; l++) dp[j][k - l][i + 1] |= 16;
            dp[j][k - t[i]][i + 1] |= 6;
          }
          if (dp[j][k][i] & 4) {
            for (int l = 1; l < t[i]; l++) dp[j - l][k][i + 1] |= 16;
            dp[j - t[i]][k][i + 1] |= 12;
          }
          if (dp[j][k][i] & 8) {
            for (int l = 1; l < t[i]; l++) dp[j][k + l][i + 1] |= 16;
            dp[j][k + t[i]][i + 1] |= 9;
          }
        }
      }
  int cont = -1;
  for (int i = 0; i < 310; i++)
    for (int j = 0; j < 310; j++)
      for (int k = 0; k < n + 1; k++)
        if (dp[i][j][k]) {
          cont++;
          break;
        }
  for (int i = 1; i < n + 1; i++)
    if (dp[150][150][i]) {
      cont++;
      break;
    }
  printf("%d", cont);
  return 0;
}
