#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int N,r[575],i,j;
double x=0,p[575];
double max(double a,double b){return a>b?a:b;}
double min(double a,double b){return a<b?a:b;}
double ch(int r1,int r2)
{
	double a=1.0*r1+r2,b=1.0*r1-r2;
	return sqrt((a*a)-(b*b));
}

int main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		double t=0,a=0;
		scanf("%d",&r[i]);
		t=r[i];
		for(j=0;j<i;j++)
		{
			t=max(t,p[j]+ch(r[i],r[j]));
		}
		p[i]=t;
		x=max(x,p[i]+r[i]);
	}
	printf("%.5lf\n",x);
	return 0;
}