#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
const int N = 1e6+10;
int t,n,m,k,l,r,op,x,y;
int f[N];
void solve(){
while(cin>>n&&n){
for(int i = 1;i<=n;i++){
cin>>f[i];
}
sort(f+1,f+1+n);
if(n%2)cout<<f[n/2+1];
else cout<<(f[n/2+1]+f[n/2])/2;
cout<<"\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}