/*
AizuOnline A1502
War
*/
#include <stdio.h>
#include <stdlib.h>
#define MAX(x,y) ((x)>(y))? (x):(y) 
int n;
int h[500];

int comp(void * x,void * y)
{
  return(*(int *)y - *(int *)x);
}
main()
{
  int n,sum,i,offset;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&(h[i]));

  qsort(h,n,sizeof(int),(__compar_fn_t)comp);
  sum = 1;offset=0;
  for(i=0;i<n;i++)
    {
      sum += MAX((h[i] - offset),0);
      if((i % 4)==3)
	offset++;
    }

  printf("%d\n",sum);

return(0);
}