import sys input = sys.stdin.readline N = int(input()) ans = 0 d = {} for _ in range(N): x = int(input()) if x in d: ans += d[x] else: d[x] = x**0.5 ans += d[x] print(ans)