import sys read = sys.stdin.buffer.read N, *nums = map(int, read().split()) s,t,r = 0, 0, 0 for x in nums: x = x**.5 + r t = s + x r = x - (t - s) s = t print(s)