#include <bits/stdc++.h>
using namespace std;
int direct[][2] = {0, 1, -1, 1, -1, 0, -1, -1, 0, -1, 1, -1, 1, 0, 1, 1};
struct node {
  long long int dir;
  long long int x, y;
  node(long long int a, long long int b, long long int c)
      : x(a), y(b), dir(c) {}
};
bool flag[300][300];
bool nowflag[300][300][9];
queue<node> que;
long long int bfs(long long int side, long long int t) {
  long long int ans = 0;
  memset(nowflag, false, sizeof(nowflag));
  while (t-- && !que.empty()) {
    node tem = que.front();
    que.pop();
    for (long long int i = 1; i <= side; ++i) {
      if (!flag[tem.x + direct[(tem.dir + 1 + 8) % 8][0] * i]
               [tem.y + direct[(tem.dir + 1 + 8) % 8][1] * i]) {
        ans++;
        flag[tem.x + direct[(tem.dir + 1 + 8) % 8][0] * i]
            [tem.y + direct[(tem.dir + 1 + 8) % 8][1] * i] = true;
      }
      if (!flag[tem.x + direct[(tem.dir - 1 + 8) % 8][0] * i]
               [tem.y + direct[(tem.dir - 1 + 8) % 8][1] * i]) {
        ans++;
        flag[tem.x + direct[(tem.dir - 1 + 8) % 8][0] * i]
            [tem.y + direct[(tem.dir - 1 + 8) % 8][1] * i] = true;
      }
    }
    if (!nowflag[tem.x + direct[(tem.dir + 1 + 8) % 8][0] * side]
                [tem.y + direct[(tem.dir + 1 + 8) % 8][1] * side]
                [(tem.dir + 1 + 8) % 8]) {
      nowflag[tem.x + direct[(tem.dir + 1 + 8) % 8][0] * side]
             [tem.y + direct[(tem.dir + 1 + 8) % 8][1] * side]
             [(tem.dir + 1 + 8) % 8] = true;
      que.push(node(tem.x + direct[(tem.dir + 1 + 8) % 8][0] * side,
                    tem.y + direct[(tem.dir + 1 + 8) % 8][1] * side,
                    (tem.dir + 1 + 8) % 8));
    }
    if (!nowflag[tem.x + direct[(tem.dir - 1 + 8) % 8][0] * side]
                [tem.y + direct[(tem.dir - 1 + 8) % 8][1] * side]
                [(tem.dir - 1 + 8) % 8]) {
      nowflag[tem.x + direct[(tem.dir - 1 + 8) % 8][0] * side]
             [tem.y + direct[(tem.dir - 1 + 8) % 8][1] * side]
             [(tem.dir - 1 + 8) % 8] = true;
      que.push(node(tem.x + direct[(tem.dir - 1 + 8) % 8][0] * side,
                    tem.y + direct[(tem.dir - 1 + 8) % 8][1] * side,
                    (tem.dir - 1 + 8) % 8));
    }
  }
  return ans;
}
int main(int argc, char const *argv[]) {
  long long int n;
  scanf("%I64d", &n);
  long long int side;
  long long int ans = 0;
  scanf("%I64d", &ans);
  for (long long int i = 1; i <= ans; ++i) {
    flag[150 + direct[0][0] * i][150 + direct[0][1] * i] = true;
    flag[150 + direct[0][0] * i][150 + direct[0][1] * i] = true;
  }
  que.push(node(150, ans + 150, 0));
  for (long long int i = 1; i < n; ++i) {
    scanf("%I64d", &side);
    ans += bfs(side, que.size());
  }
  printf("%I64d\n", ans);
  return 0;
}
