if __name__ == '__main__':
try:
while True:
N = int(input())
if N == 0:
break
data = list()
for _ in range(N):
data.append(int(input()))
data.sort()
if N % 2 == 1:
print(data[N//2])
else:
print(int((data[N//2-1]+data[N//2])/2))
except EOFError:
pass