#include typedef long long ll; using namespace std; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; using pii = pair; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define COUT(x) cout<<(x)<<"\n" #define COUT15(x) cout << fixed << setprecision(15) << (x) << "\n"; int main(){ int n; cin >> n; vector a(n); REP(i,n) cin >> a[i]; sort(a.begin(),a.end()); if(n%2!=0)COUT(a[n/2]); else COUT((a[n/2-1]+a[n/2])/2); }