#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

int main(){
	int n;
	cin >> n;
	vector<ll> h(n);
	for(int i = 0; i < n; ++i){ cin >> h[i]; }
	sort(h.begin(), h.end(), greater<ll>());
	ll answer = 1;
	for(int i = 0; i < n; ++i){
		ll lost = i / 4;
		answer += max(0ll, h[i] - lost);
	}
	cout << answer << endl;
	return 0;
}