#include <iostream>
#include<algorithm>
using namespace std;
const int N =10010;
int a[N];
int main() {
    int n;
    while(cin>>n){
        if(n==0)break;
        for(int i = 0;i<n;i++)
            scanf("%d",&a[i]);
        sort(a,a+n);
        if(n%2==0)cout<<(a[n/2-1]+a[n/2])/2<<endl;
        else cout<<a[n/2]<<endl;

    }
    
    
}
// 64 位输出请用 printf("%lld")