#include <bits/stdc++.h>
using namespace std;
void move(int64_t &x, int64_t &y, int64_t dir, int64_t t) {
  if (dir == 0) {
    y += t;
  } else if (dir == 1) {
    y += t;
    x -= t;
  } else if (dir == 2) {
    x -= t;
  } else if (dir == 3) {
    y -= t;
    x -= t;
  } else if (dir == 4) {
    y -= t;
  } else if (dir == 5) {
    y -= t;
    x += t;
  } else if (dir == 6) {
    x += t;
  } else if (dir == 7) {
    y += t;
    x += t;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int64_t n;
  cin >> n;
  const int64_t N = 301;
  vector<vector<char>> board(N, vector<char>(N));
  vector<int64_t> t(n);
  for (int64_t i = 0; i < n; ++i) cin >> t[i];
  int64_t x = N / 2, y = N / 2;
  int64_t dir = 0;
  int64_t i = 0;
  for (; i < n - 1; ++i) {
    move(x, y, dir, t[i]);
    dir = (dir + 1) % 8;
  }
  while (i > 0) {
    int64_t ox = x, oy = y;
    for (int64_t k = 0; k < t[i]; ++k) {
      move(x, y, dir, 1);
      board[x][y] = 1;
    }
    x = ox;
    y = oy;
    vector<vector<char>> nb = board;
    for (int64_t u = 0; u < N; ++u) {
      for (int64_t v = 0; v < N; ++v) {
        int64_t myx = v - y + x;
        int64_t myy = x - u + y;
        if (myx >= 0 && myx < N && myy >= 0 && myy < N) {
          if (board[u][v]) {
            nb[myx][myy] = 1;
          }
        }
      }
    }
    swap(board, nb);
    i--;
    dir = (dir + 7) % 8;
    move(x, y, (dir + 4) % 8, t[i]);
  }
  for (int64_t k = 0; k < t[i]; ++k) {
    move(x, y, dir, 1);
    board[x][y] = 1;
  }
  int64_t cnt = 0;
  for (int64_t u = 0; u < N; ++u) {
    for (int64_t v = 0; v < N; ++v) {
      if (board[u][v]) cnt++;
    }
  }
  cout << cnt << "\n";
  return 0;
}
