n = int(input())
v = list(map(int, input().split()))
# v = sort(v)
if n < 1:
    print(0)
if n <= 2:
    print(sum(v) / 2)
else:
    for i in range(n):
        vmax = max(v)
        v2 = sorted(v)[-2]
        v3 = sorted(v)[-3]
        vv = (v2 + v3) / 2
    print((vmax + vv) / 2)