#include <bits/stdc++.h>
const int INF = 2e9 + 123;
using namespace std;
template <class T>
inline const T sqr(const T& x) {
  return x * x;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long popcnt(long long mask) {
  long long cnt = 0;
  while (mask) cnt += mask % 2, mask /= 2;
  return cnt;
}
unsigned long long powi(unsigned long long a, unsigned long long b,
                        long long mod = 1000000007) {
  if (b < 2) return b ? a : 1;
  return (powi((a * a) % mod, b / 2, mod) * (b % 2 ? a : 1LL)) % mod;
}
long long mod7 = 1000000007;
long long mod9 = 1000000009;
bool isprime(long long n) {
  if (n < 2) return 0;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int a[33];
int n;
int m[333][333];
int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dp[33][8][333][333];
void print(int d) {
  for (int i = 155 - d; i <= 155 + d; i++) {
    for (int j = 155 - d; j <= 155 + d; j++) {
      cout << ((m[i][j]) ? '#' : '.');
    }
    cout << endl;
  }
  cout << endl;
}
void go(int level, int dir, int x, int y) {
  if (level == n) return;
  if (dp[level][dir][x][y]) return;
  dp[level][dir][x][y] = 1;
  for (int i = 0; i < a[level]; i++) {
    m[x][y] = 1;
    x += dx[dir];
    y += dy[dir];
  }
  x -= dx[dir];
  y -= dy[dir];
  go(level + 1, (dir + 7) % 8, x + dx[(dir + 7) % 8], y + dy[(dir + 7) % 8]);
  go(level + 1, (dir + 1) % 8, x + dx[(dir + 1) % 8], y + dy[(dir + 1) % 8]);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  go(0, 0, 155, 155);
  int ans = 0;
  for (int i = 0; i < (333); i++)
    for (int j = 0; j < (333); j++)
      if (m[i][j]) ans++;
  cout << ans;
}
