#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<unordered_map>
#include<string.h>
#define int long long
using namespace std;

signed main() {
	int ans = 0;
	int a; cin >> a;
	vector<int>V;
	for (int b = 0; b < a; b++) {
		int c; cin >> c;
		V.push_back(-c);
	}
	sort(V.begin(), V.end());
	for (int b = 0; b < a; b++) {
		int c = -V[b];
		ans += max(0ll, c - b / 4);
	}
	cout << ans+1 << endl;
}