#include <bits/stdc++.h>
using int_t = long long int;
constexpr int_t inf = 1000000000000000000;
int nodes[304][304][154];
struct Vec2 {
  int_t x;
  int_t y;
  Vec2(int_t x, int_t y) : x(x), y(y) {}
};
Vec2 operator+(const Vec2& lhs, const Vec2& rhs) {
  return Vec2(lhs.x + rhs.x, lhs.y + rhs.y);
}
enum Dir { T, TL, L, BL, B, BR, R, TR };
Vec2 dirs[] = {{0, 1},  {-1, 1}, {-1, 0}, {-1, -1},
               {0, -1}, {1, -1}, {1, 0},  {1, 1}};
int exp_dirs[8][2] = {{TR, TL}, {T, L}, {TL, BL}, {L, B},
                      {BL, BR}, {B, R}, {BR, TR}, {R, T}};
bool is_exp[154];
bool visited[304][304];
bool visited_t[304][304][154];
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int_t n;
  std::cin >> n;
  std::vector<int_t> t(n);
  int_t total = 0;
  for (auto& ti : t) {
    std::cin >> ti;
    total += ti;
    is_exp[total] = true;
  }
  std::queue<std::pair<Vec2, int>> q;
  q.emplace(Vec2(151, 151), 0);
  nodes[151][151][0] = (1 << T);
  visited[151][151] = true;
  int_t result = 0;
  bool first = true;
  while (!q.empty()) {
    Vec2 pos = q.front().first;
    int time = q.front().second;
    q.pop();
    if (!visited[pos.x][pos.y]) {
      ++result;
      visited[pos.x][pos.y] = true;
    }
    if (first) {
      visited[151][151] = false;
      first = false;
    }
    if (time >= total) {
      continue;
    }
    for (int i = 0; i < 8; ++i) {
      if ((nodes[pos.x][pos.y][time] & (1 << i)) != 0) {
        if (is_exp[time]) {
          for (int dir_e : exp_dirs[i]) {
            Vec2 next = pos + dirs[dir_e];
            nodes[next.x][next.y][time + 1] |= (1 << dir_e);
            if (!visited_t[next.x][next.y][time + 1]) {
              q.emplace(next, time + 1);
              visited_t[next.x][next.y][time + 1] = true;
            }
          }
        } else {
          Vec2 next = pos + dirs[i];
          nodes[next.x][next.y][time + 1] |= (1 << i);
          if (!visited_t[next.x][next.y][time + 1]) {
            q.emplace(next, time + 1);
            visited_t[next.x][next.y][time + 1] = true;
          }
        }
      }
    }
  }
  std::cout << result << '\n';
  return 0;
}
