#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define N 512
#define SQ(X) ((X) * (X))
#define MAX(A,B) ((A) < (B) ? (B) : (A))

static int r[N];
static int n;

static double d[N];

main()
{
  double rval;
  int i, j;
  
  scanf("%d", &n);
  for (i = 0; i < n; ++i) {
    scanf("%d", &r[i]);
    
    d[i] = r[i];
    for (j = 0; j < i; ++j) {
      const double tmp = d[j] + sqrt(SQ(r[i] + r[j]) - SQ(r[i] - r[j]));
      d[i] = MAX(d[i], tmp);
    }
  }
  
  rval = 0.;
  for (i = 0; i < n; ++i) {
    rval = MAX(rval, d[i] + r[i]);
  }
  printf("%.4f\n", rval);
  
  return EXIT_SUCCESS;
}