#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; int main() { int n, k[1005]; cin >> n; for (int i = 0; i < n; ++i) { cin >> k[i]; } sort(k, k + n); if (n % 2 == 1) { cout << k[n / 2] << endl; return 0; } cout << (k[n / 2] + k[n / 2 - 1]) / 2 << endl; }