#include <bits/stdc++.h>
using namespace std;
long long n, hs, i, a[1010], d[500][500],
    dx[10] = {0, 1, 1, 0, -1, -1, -1, 0, 1},
    dy[10] = {0, 0, 1, 1, 1, 0, -1, -1, -1};
bool b[500][500][10][40];
long long rct1(long long aa) {
  if (aa == 8)
    return 1;
  else
    return aa + 1;
}
long long rct2(long long aa) {
  if (aa == 1)
    return 8;
  else
    return aa - 1;
}
pair<long long, long long> jln(long long aa, long long bb, long long cc,
                               long long dd) {
  long long hh = a[dd], ii;
  long long xx = aa, yy = bb;
  for (ii = 1; ii <= hh; ii++) {
    xx += dx[cc];
    yy += dy[cc];
    if (d[xx][yy] == 0) {
      d[xx][yy] = 1;
      hs++;
    }
  }
  return make_pair(xx, yy);
}
void rmt(long long aa, long long bb, long long cc, long long dd) {
  if (b[aa][bb][cc][dd] == 0 && dd <= n) {
    b[aa][bb][cc][dd] = 1;
    pair<long long, long long> pp;
    pp = jln(aa, bb, cc, dd);
    rmt(pp.first, pp.second, rct1(cc), dd + 1);
    rmt(pp.first, pp.second, rct2(cc), dd + 1);
  }
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  rmt(200, 200, 1, 1);
  cout << hs << "\n";
}
