#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    while(cin>>n){
        if(n==0)return 0;
        vector<int>v;
        while(n--){
            int temp;cin>>temp;
            v.push_back(temp);
        }
        sort(v.begin(),v.end());
        if(v.size()%2==1)//奇数
            cout<<v[v.size()/2]<<endl;
        else
            cout<<(v[v.size()/2]+v[v.size()/2-1])/2<<endl;  
    }
}
// 64 位输出请用 printf("%lld")