#include <bits/stdc++.h>
using namespace std;

#define REP(i, s, e) for(int i = (int)s; i < (int) e; i++)
#define rep(i, n) REP(i, 0 ,n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define fi first
#define se second
#define pb push_back
#define mp nake_pair

typedef long long ll;

int main(){
    int n;
    cin>>n;
    ll ans = 0LL;
    vector<int> h(n);
    rep(i, n) cin>>h[i];
    sort(rall(h));
    rep(i, n){
        ans += max(0, h[i]-i/4);
    }
    cout<<ans+1LL<<endl;
}