#include <bits/stdc++.h>
using namespace std;
const long long MOD = static_cast<int>(1e9) + 7;
using namespace std::rel_ops;
inline long long bit(int x) { return 1LL << x; }
template <class T>
inline int size(const T& a) {
  return (int)a.size();
}
template <class T>
inline bool chmin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
inline int clamp(T v, T lo, T hi) {
  return (v > hi) - (v < lo);
}
template <class T>
inline bool chmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T>
inline pair<vector<T>, char> operator*(const vector<T>& v, const char& c) {
  return make_pair(v, c);
}
template <class T>
inline istream& operator>>(istream& is, vector<T>& v) {
  for (auto& x : v) is >> x;
  return is;
}
template <class T>
inline ostream& operator<<(ostream& os, const pair<vector<T>, char>& v) {
  bool t = 0;
  for (const T& x : v.first) {
    if (t) os << v.second;
    os << x;
    t = 1;
  }
  return os;
}
template <class T>
inline ostream& operator<<(ostream& os, vector<T>& v) {
  return os << v * ' ';
}
struct before_main {
  before_main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
    ;
  };
} __before_main;
int dx[] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[] = {1, 1, 0, -1, -1, -1, 0, 1};
int arr[30];
int b[600][600];
int s[2][600][600];
int d[2][600][600];
void hoge(int y, int x, int l, int dir, int nxt) {
  for (int _ = 0, __len = static_cast<int>(l); _ < __len; _++) {
    y += dy[dir];
    x += dx[dir];
    b[y][x] = 1;
  }
  s[nxt][y][x] = 1;
  d[nxt][y][x] |= 1 << dir;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0, i_len = static_cast<int>(n); i < i_len; i++) cin >> arr[i];
  int now = 0, nxt = 1;
  int y = 300;
  int x = 300;
  while (arr[0]--) {
    y += dy[0];
    x += dx[0];
    b[y][x] = 1;
  }
  s[now][y][x] = 1;
  d[now][y][x] |= 1 << 0;
  for (int z = 0, z_len = static_cast<int>(n - 1); z < z_len; z++) {
    for (int i = 0, i_len = static_cast<int>(600); i < i_len; i++)
      for (int j = 0, j_len = static_cast<int>(600); j < j_len; j++) {
        if (s[now][i][j] == 1) {
          for (int dir = 0, dir_len = static_cast<int>(8); dir < dir_len;
               dir++) {
            if ((d[now][i][j] & (1 << dir)) == 0) continue;
            int d1 = (dir + 1) % 8;
            int d2 = (dir + 7) % 8;
            hoge(i, j, arr[z + 1], d1, nxt);
            hoge(i, j, arr[z + 1], d2, nxt);
          }
        }
      }
    memset(s[now], 0, sizeof(s[now]));
    memset(d[now], 0, sizeof(d[now]));
    swap(now, nxt);
  }
  int ans = 0;
  for (int i = 0, i_len = static_cast<int>(600); i < i_len; i++)
    for (int j = 0, j_len = static_cast<int>(600); j < j_len; j++) {
      ans += b[i][j];
    }
  cout << ans << endl;
}
