#include <bits/stdc++.h>
std::pair<int, int> advance(std::pair<int, int> pos, int dir) {
  switch (dir) {
    case 0:
      return {pos.first + 1, pos.second};
    case 1:
      return {pos.first + 1, pos.second + 1};
    case 2:
      return {pos.first, pos.second + 1};
    case 3:
      return {pos.first - 1, pos.second + 1};
    case 4:
      return {pos.first - 1, pos.second};
    case 5:
      return {pos.first - 1, pos.second - 1};
    case 6:
      return {pos.first, pos.second - 1};
    case 7:
      return {pos.first + 1, pos.second - 1};
  }
}
std::pair<int, int> get_next(int dir) {
  switch (dir) {
    case 0:
      return {7, 1};
    case 1:
      return {0, 2};
    case 2:
      return {1, 3};
    case 3:
      return {2, 4};
    case 4:
      return {5, 3};
    case 5:
      return {6, 4};
    case 6:
      return {5, 7};
    case 7:
      return {6, 0};
  }
}
int n;
int t[30];
std::map<std::pair<int, int>, bool> cells;
std::map<std::pair<std::pair<int, int>, std::pair<int, int> >, bool> q;
void firework(std::pair<int, int> pos, int rec, int dir) {
  if (q[{pos, {rec, dir}}]) return;
  q[{pos, {rec, dir}}] = true;
  if (rec == n) return;
  for (int i = 0; i < t[rec]; i++) {
    pos = advance(pos, dir);
    cells[pos] = true;
  }
  std::pair<int, int> next = get_next(dir);
  firework(pos, rec + 1, next.first);
  firework(pos, rec + 1, next.second);
}
int main() {
  std::cin >> n;
  for (int i = 0; i < n; i++) std::cin >> t[i];
  firework({-1, 0}, 0, 0);
  std::cout << cells.size() << "\n";
}
