#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N;
  cin >> N;

  vector<double> r(N);  
  for ( int i = 0; i < N; i++ ) {
    cin >> r[i];    
  }

  vector<double> p(N);
  double ans = r[0]*2;  
  p[0] = r[0];
  for ( int i = 1; i < N; i++ ) {
    p[i] = r[i];    
    for ( int j = 0; j < i; j++ ) {
      double a = abs(r[i]-r[j]);
      double b = r[i]+r[j];      
      double d = sqrt(b*b-a*a);      
      p[i] = max(p[i], p[j]+d);      
    }
    ans = max(ans, p[i]+r[i]);    
  }

  cout << ans << endl;
  
  return 0;
}

