#include <bits/stdc++.h>
const int D[8][2] = {{1, 0},  {1, 1},   {0, 1},  {-1, 1},
                     {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};
int main() {
  int n, t;
  bool d[500][500] = {};
  std::set<std::array<int, 3>> q[31];
  int v, r(0);
  q[0].insert({{{250, 250, 0}}});
  std::scanf("%d", &n);
  for (int i(0); i < n; ++i) {
    std::scanf("%d", &t);
    for (auto p : q[i]) {
      r += !d[p[0]][p[1]];
      d[p[0]][p[1]] = true;
      for (int i(1); i < t; ++i) {
        p[0] += D[p[2]][0];
        p[1] += D[p[2]][1];
        r += !d[p[0]][p[1]];
        d[p[0]][p[1]] = true;
      }
      v = (p[2] + 1) % 8;
      q[i + 1].insert({{{p[0] + D[v][0], p[1] + D[v][1], v}}});
      v = (p[2] + 7) % 8;
      q[i + 1].insert({{{p[0] + D[v][0], p[1] + D[v][1], v}}});
    }
    q[i].clear();
  }
  std::printf("%d\n", r);
  return 0;
}
