#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  int x;
  int y;
  Point(int xx, int yy) {
    x = xx;
    y = yy;
  }
};
int x_dir[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int y_dir[8] = {1, 1, 0, -1, -1, -1, 0, 1};
bool visited[301][301];
vector<Point> points;
vector<int> times;
int max_depth;
void visit(bool f, int x, int y) { visited[149 - x][149 - y] = f; }
bool is_visited(int x, int y) { return visited[149 - x][149 - y]; }
void dfs(int x, int y, int cur_depth, int last_direction) {
  if (cur_depth == max_depth) return;
  int cur_dir = (last_direction + 1) % 8;
  int cur_time = times[cur_depth];
  int new_x = x + cur_time * x_dir[cur_dir];
  int new_y = y + cur_time * y_dir[cur_dir];
  int old_x = x;
  int old_y = y;
  dfs(new_x, new_y, cur_depth + 1, cur_dir);
  for (int i = 1; i <= cur_time; ++i) {
    x += x_dir[cur_dir];
    y += y_dir[cur_dir];
    {
      visit(true, x, y);
      points.emplace_back(x, y);
    }
  }
  auto old_size = points.size();
  bool is_diag = (x_dir[last_direction] * y_dir[last_direction] != 0);
  bool is_ud = (x_dir[last_direction] == 0);
  for (int i = 0; i < old_size; ++i) {
    int cur_x, cur_y, ref_x, ref_y;
    cur_x = points[i].x;
    cur_y = points[i].y;
    if (is_diag) {
      ref_x = old_x - old_y + cur_y;
      ref_y = old_x - cur_x + old_y;
    } else if (is_ud) {
      ref_y = cur_y;
      ref_x = old_x + (old_x - cur_x);
    } else {
      ref_x = cur_x;
      ref_y = old_y + old_y - cur_y;
    }
    if (!is_visited(ref_x, ref_y)) {
      visit(true, ref_x, ref_y);
      points.emplace_back(ref_x, ref_y);
    }
  }
}
int main(int argc, char const *argv[]) {
  int n;
  int temp;
  cin >> n;
  max_depth = n;
  times.resize(n);
  for (int i = 0; i < n; ++i) cin >> times[i];
  for (int i = 0; i < 301; ++i)
    for (int j = 0; j < 301; ++j) visited[i][j] = false;
  for (int i = 0; i < times[0]; i++) visit(true, 0, i);
  dfs(0, times[0] - 1, 1, 0);
  int ans = 0;
  for (int i = 0; i < 301; ++i)
    for (int j = 0; j < 301; ++j)
      if (visited[i][j]) ans++;
  cout << ans << endl;
  return 0;
}
