#include<stdio.h>
#include<stdlib.h>
int N,H[500],i,j;
long long R=1;
int cmp(const int *a,const int *b){return *b-*a;}
int main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&H[i]);
	qsort(H,N,4,cmp);
	for(i=0;i<N;i++)
		R+=(H[i]-i/4)>0?(H[i]-i/4):0;
	printf("%lld\n",R);
	return 0;
}