import numpy as np N = int(input()) a = np.array(list(map(float, input().split()))) s = np.sum(a) t = np.sum(a**2) ans = (s*s-t)/s+1 print(ans)