import sys
N = int(input())
v = list(map(int,input().split()))
max_num = max(v)
v.remove(max_num)

if N >2:
	x = min(v)
	v.remove(x)
	y = min(v)
	v.remove(y)
	value = (x+y)/2

	if len(v) !=0:
		value = (value+min(v))/2
		v.remove(min(v))
	print((value+max_num)/2)
	sys.exit()

else:
	print((max_num+v[0])/2)
	sys.exit()
