#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T1>
ostream &operator<<(ostream &out, pair<T, T1> obj) {
  out << "(" << obj.first << "," << obj.second << ")";
  return out;
}
template <typename T, typename T1>
ostream &operator<<(ostream &out, map<T, T1> cont) {
  typename map<T, T1>::const_iterator itr = cont.begin();
  typename map<T, T1>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, set<T> cont) {
  typename set<T>::const_iterator itr = cont.begin();
  typename set<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, multiset<T> cont) {
  typename multiset<T>::const_iterator itr = cont.begin();
  typename multiset<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T,
          template <typename ELEM, typename ALLOC = allocator<ELEM>> class CONT>
ostream &operator<<(ostream &out, CONT<T> cont) {
  typename CONT<T>::const_iterator itr = cont.begin();
  typename CONT<T>::const_iterator ends = cont.end();
  for (; itr != ends; ++itr) out << *itr << " ";
  out << endl;
  return out;
}
template <typename T, unsigned int N, typename CTy, typename CTr>
typename enable_if<!is_same<T, char>::value, basic_ostream<CTy, CTr> &>::type
operator<<(basic_ostream<CTy, CTr> &out, const T (&arr)[N]) {
  for (auto i = 0; i < N; ++i) out << arr[i] << " ";
  out << endl;
  return out;
}
template <typename T>
T gcd(T a, T b) {
  T min_v = min(a, b);
  T max_v = max(a, b);
  while (min_v) {
    T temp = max_v % min_v;
    max_v = min_v;
    min_v = temp;
  }
  return max_v;
}
template <typename T>
T lcm(T a, T b) {
  return (a * b) / gcd(a, b);
}
template <typename T>
T fast_exp_pow(T base, T exp, T mod) {
  long long res = 1;
  while (exp) {
    if (exp & 1) {
      res *= base;
      res %= mod;
    }
    exp >>= 1;
    base *= base;
    base %= mod;
  }
  return res % mod;
}
int N, answer;
int cells[35];
bool visited[310][310][35][5][3][3];
bool check;
int sign(double val) {
  if (val > 0.5) return 1;
  if (val < -0.5) return -1;
  return 0;
}
void draw(int ind, int cnt, int angle, int x, int y, int dx, int dy) {
  if (ind == N) return;
  if (visited[150 + x][150 + y][ind][cnt][1 + dx][1 + dy]) return;
  visited[150 + x][150 + y][ind][cnt][1 + dx][1 + dy] = true;
  if (cnt < cells[ind]) {
    int new_x = x + dx;
    int new_y = y + dy;
    draw(ind, cnt + 1, angle, new_x, new_y, dx, dy);
  } else {
    double rot_x = cos((angle + 45) * acos(-1) / 180);
    double rot_y = sin((angle + 45) * acos(-1) / 180);
    int new_dx = dx, new_dy = dy;
    new_dx = sign(rot_x);
    new_dy = sign(rot_y);
    draw(ind + 1, 1, angle + 45, x + new_dx, y + new_dy, new_dx, new_dy);
    rot_x = cos((angle - 45) * acos(-1) / 180);
    rot_y = sin((angle - 45) * acos(-1) / 180);
    new_dx = dx, new_dy = dy;
    new_dx = sign(rot_x);
    new_dy = sign(rot_y);
    draw(ind + 1, 1, angle - 45, x + new_dx, y + new_dy, new_dx, new_dy);
  }
}
int main() {
  scanf("%d", &N);
  for (auto i = 0; i < N; ++i) scanf("%d", cells + i);
  memset(visited, false, sizeof(visited));
  draw(0, 1, 90, 0, 0, 0, 1);
  for (auto i = -150; i <= 150; ++i)
    for (auto j = -150; j <= 150; ++j) {
      check = false;
      for (auto a = -1; a <= 1; ++a)
        for (auto b = -1; b <= 1; ++b)
          for (auto k = 0; k < 30; ++k)
            for (auto m = 1; m <= 5; ++m)
              check |= visited[i + 150][j + 150][k][m][a + 1][b + 1];
      if (check) ++answer;
    }
  printf("%d\n", answer);
  return 0;
}
