def sqrt_floor(x): ceil = x floor = 1 while ceil > floor + 1: m = (ceil+floor)//2 if m*m <= x: floor = m else: ceil = m return floor import decimal from decimal import Decimal decimal.getcontext().prec=20 inv_error = 10**20 N = int(input()) ans = Decimal(0) for _ in range(N): x = int(input()) p = sqrt_floor(x) if p*p == x: ans += p else: R = 1 U, V = 2, 2*p a, b = 2*p, x-p*p while R < inv_error: R *= 2*p U, V = V, a*V + b*U ans += Decimal(V)/Decimal(U) - p print(ans)