#include <bits/stdc++.h>
inline void in(int &MAGNUS) { scanf("%d", &MAGNUS); }
inline void out(int MAGNUS) { printf("%d\n", MAGNUS); }
inline void in(int &MAGNUS, int &CLAR) { scanf("%d%d", &MAGNUS, &CLAR); }
inline void out(int MAGNUS, int CLAR) { printf("%d %d\n", MAGNUS, CLAR); }
inline void inl(long long &LIV) { scanf("%lld", &LIV); }
inline void inl(long long &LIV, long long &MART) {
  scanf("%lld%lld", &LIV, &MART);
}
inline void outl(long long LIV) { printf("%lld\n", LIV); }
inline void outl(long long LIV, long long MART) {
  printf("%lld %lld\n", LIV, MART);
}
using namespace std;
int tl = 0, t = 1, tr = 2, le = 3, ri = 4, bl = 5, b = 6, br = 7;
int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
pair<int, int> nx[] = {make_pair(le, t),  make_pair(tl, tr), make_pair(t, ri),
                       make_pair(tl, bl), make_pair(tr, br), make_pair(le, b),
                       make_pair(bl, br), make_pair(b, ri)};
bool vis[505][505];
bool done[505][505][8][31];
int N, x[35];
void spread(int r, int c, int dir, int cur) {
  if (cur > N) return;
  if (done[r][c][dir][cur]) return;
  done[r][c][dir][cur] = 1;
  for (int i = 1; i <= x[cur]; i++) {
    vis[r][c] = 1;
    r += dx[dir];
    c += dy[dir];
  }
  r -= dx[dir];
  c -= dy[dir];
  spread(r + dx[nx[dir].first], c + dy[nx[dir].first], nx[dir].first, cur + 1);
  spread(r + dx[nx[dir].second], c + dy[nx[dir].second], nx[dir].second,
         cur + 1);
}
int main() {
  in(N);
  for (int i = 1; i <= N; i++) in(x[i]);
  memset(vis, 0, sizeof(vis));
  memset(done, 0, sizeof(done));
  spread(250, 250, t, 1);
  int ans = 0;
  for (int i = 1; i <= 500; i++)
    for (int j = 1; j <= 500; j++) ans += vis[i][j];
  out(ans);
  return 0;
}
