#include <bits/stdc++.h>
using namespace std;
int n, a[31];
const int dx[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
pair<int, int> expand(int x, int y, int ty, int len) {
  return make_pair(x + dx[ty] * len, y + dy[ty] * len);
}
pair<int, int> mirror(int x, int y, int ty, int arg1, int arg2) {
  if (ty == 0 || ty == 4) return make_pair(x, arg2 + (arg2 - y));
  if (ty == 1 || ty == 5)
    return make_pair(arg1 + (arg2 - y), arg2 + (arg1 - x));
  if (ty == 2 || ty == 6) return make_pair(arg1 + (arg1 - x), y);
  if (ty == 3 || ty == 7)
    return make_pair(arg1 - (arg2 - y), arg2 - (arg1 - x));
  return pair<int, int>();
}
set<pair<int, int> > dfs(int x, int y, int ty, int k) {
  if (k == n + 1) return set<pair<int, int> >();
  pair<int, int> term = expand(x, y, ty, a[k]);
  set<pair<int, int> > lf = dfs(term.first, term.second, (ty + 7) % 8, k + 1);
  set<pair<int, int> > tot = lf;
  for (set<pair<int, int> >::iterator it = lf.begin(); it != lf.end(); ++it)
    tot.insert(mirror(it->first, it->second, ty, x, y));
  for (int i = 1; i <= a[k]; ++i)
    tot.insert(make_pair(x + dx[ty] * i, y + dy[ty] * i));
  return tot;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  printf("%d", int(dfs(-1, 0, 0, 1).size()));
  return 0;
}
