#include <bits/stdc++.h>
using namespace std;
bool path[310][310][31][10];
bool grid[310][310];
int a[31], n, c;
struct node {
  int X1, Y1, F1, X2, Y2, F2;
};
pair<int, int> func1(int f) {
  if (f == 1) return make_pair(0, 1);
  if (f == 2) return make_pair(-1, 1);
  if (f == 3) return make_pair(1, 1);
  if (f == 4) return make_pair(-1, 0);
  if (f == 5) return make_pair(1, 0);
  if (f == 6) return make_pair(-1, -1);
  if (f == 7) return make_pair(1, -1);
  if (f == 8) return make_pair(0, -1);
}
node func2(int f) {
  if (f == 1) return {1, 1, 3, -1, 1, 2};
  if (f == 2) return {-1, 0, 4, 0, 1, 1};
  if (f == 3) return {1, 0, 5, 0, 1, 1};
  if (f == 4) return {-1, 1, 2, -1, -1, 6};
  if (f == 5) return {1, 1, 3, 1, -1, 7};
  if (f == 6) return {-1, 0, 4, 0, -1, 8};
  if (f == 7) return {1, 0, 5, 0, -1, 8};
  if (f == 8) return {1, -1, 7, -1, -1, 6};
}
void dfs(int x, int y, int p, int f) {
  if (p == n) return;
  if (path[x][y][p][f]) return;
  path[x][y][p][f] = true;
  pair<int, int> r = func1(f);
  int dx = r.first;
  int dy = r.second;
  for (int i = 0; i < a[p]; i++) {
    if (!grid[x][y]) c++;
    grid[x][y] = true;
    if (i == a[p] - 1) break;
    x += dx;
    y += dy;
  }
  node rr = func2(f);
  dfs(x + rr.X1, y + rr.Y1, p + 1, rr.F1);
  dfs(x + rr.X2, y + rr.Y2, p + 1, rr.F2);
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  dfs(155, 155, 0, 1);
  cout << c;
  return 0;
}
