#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
typedef long long ll;
int n;
ll H[555];
int main(){
  scanf("%d",&n);
  for(int i=0;i<n;i++) scanf("%lld",&H[i]);
  sort(H,H+n);
  ll mi=0;
  ll res=1;
  for(int i=n-1,j=1;i>-1;i--,j++){
    if(H[i]-mi<=0) break;
    res+=(H[i]-mi);
    if(j%4==0) mi++;
  }
  printf("%lld\n",res);
}