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

using namespace std;

typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<int> V;
  
  while(n--){
    ll in;
    cin >> in;
    V.push_back(in);
  }

  sort(V.begin(),V.end());
  reverse(V.begin(),V.end());

  ll ans = 1;

  for(int i = 0; i < V.size(); i++){
    if(V[i]-i/4 >= 0) ans += V[i]-i/4;
    else break;
  }
  cout << ans << endl;
  return 0;
}