#include <bits/stdc++.h>
using namespace std;
using namespace std;
int dp[405][405][35][10], cx[50], us[405][405], n;
int fg;
void f(int in, int x, int y, int d, int c) {
  if (dp[x][y][in][d]) return;
  dp[x][y][in][d] = 1;
  if (in == n) return;
  if (d == 0) {
    if (fg == 1) {
      y -= 1;
    }
    for (int j = 0; j < c; ++j) us[x][y - j] = 1;
    y -= c - 1;
    fg = 1;
    f(in + 1, x, y, 4, cx[in + 1]);
    f(in + 1, x, y, 5, cx[in + 1]);
  } else if (d == 1) {
    x += 1;
    for (int j = 0; j < c; ++j) us[x + j][y] = 1;
    x += c - 1;
    f(in + 1, x, y, 5, cx[in + 1]);
    f(in + 1, x, y, 6, cx[in + 1]);
  } else if (d == 2) {
    y += 1;
    for (int j = 0; j < c; ++j) us[x][y + j] = 1;
    y += c - 1;
    f(in + 1, x, y, 7, cx[in + 1]);
    f(in + 1, x, y, 6, cx[in + 1]);
  } else if (d == 3) {
    x -= 1;
    for (int j = 0; j < c; ++j) us[x - j][y] = 1;
    x -= c - 1;
    f(in + 1, x, y, 4, cx[in + 1]);
    f(in + 1, x, y, 7, cx[in + 1]);
  } else if (d == 4) {
    x -= 1;
    y -= 1;
    for (int j = 0; j < c; ++j) us[x - j][y - j] = 1;
    x -= c - 1;
    y -= c - 1;
    f(in + 1, x, y, 0, cx[in + 1]);
    f(in + 1, x, y, 3, cx[in + 1]);
  } else if (d == 5) {
    x += 1;
    y -= 1;
    for (int j = 0; j < c; ++j) us[x + j][y - j] = 1;
    x += c - 1;
    y -= c - 1;
    f(in + 1, x, y, 0, cx[in + 1]);
    f(in + 1, x, y, 1, cx[in + 1]);
  } else if (d == 6) {
    x += 1;
    y += 1;
    for (int j = 0; j < c; ++j) us[x + j][y + j] = 1;
    x += c - 1;
    y += c - 1;
    f(in + 1, x, y, 1, cx[in + 1]);
    f(in + 1, x, y, 2, cx[in + 1]);
  } else {
    x -= 1;
    y += 1;
    for (int j = 0; j < c; ++j) us[x - j][y + j] = 1;
    x -= c - 1;
    y += c - 1;
    f(in + 1, x, y, 2, cx[in + 1]);
    f(in + 1, x, y, 3, cx[in + 1]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> cx[i];
  }
  us[200][200] = 1;
  f(0, 200, 200, 0, cx[0]);
  int res = 0;
  for (int i = 0; i < 405; ++i) {
    for (int j = 0; j < 405; ++j)
      if (us[i][j]) res += 1;
  }
  cout << res << endl;
}
