#include using namespace std; int main(){ int n; cin >> n; vector a(n); for(int i = 0; i < n; i++){ cin >> a.at(i); } sort(a.begin(), a.end()); if(n % 2 == 0){ cout << (a.at(0) + a.at(n - 1)) / 2 << endl; } else if(n % 2 == 1){ cout << a.at((0 + n - 1) / 2) << endl; } }