n = int(input())

lis = list(map(int, input().split()))

lis = sorted(lis)

if len(lis) == 2:
    print((lis[0]+lis[1])/2)
    exit()
else:
    a = (lis[n-2]+lis[n-3])/2
    ans = (a+lis[n-1])/2
    
print(ans)