#include <iostream>
#include <map>
using namespace std;
int main() {
int count = 0, elem;
unsigned long long sum = 0;
map<int, int> MAP;
while (cin >> elem) {
if (MAP.find(elem) == MAP.end()) MAP[elem] = 1;
else MAP[elem]++;
sum += elem;
count++;
}
sum -= MAP.begin()->first * MAP.begin()->second + (--MAP.end())->first * (--MAP.end())->second;
count -= MAP.begin()->second + (--MAP.end())->second;
cout << sum / count + 1 * (sum % count > count / 2);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgY291bnQgPSAwLCBlbGVtOwoJdW5zaWduZWQgbG9uZyBsb25nIHN1bSA9IDA7CgltYXA8aW50LCBpbnQ+IE1BUDsKCXdoaWxlIChjaW4gPj4gZWxlbSkgewoJCWlmIChNQVAuZmluZChlbGVtKSA9PSBNQVAuZW5kKCkpIE1BUFtlbGVtXSA9IDE7CgkJZWxzZSBNQVBbZWxlbV0rKzsKCQlzdW0gKz0gZWxlbTsKCQljb3VudCsrOwoJfQoJc3VtIC09IE1BUC5iZWdpbigpLT5maXJzdCAqIE1BUC5iZWdpbigpLT5zZWNvbmQgKyAoLS1NQVAuZW5kKCkpLT5maXJzdCAqICgtLU1BUC5lbmQoKSktPnNlY29uZDsKCWNvdW50IC09IE1BUC5iZWdpbigpLT5zZWNvbmQgKyAoLS1NQVAuZW5kKCkpLT5zZWNvbmQ7Cgljb3V0IDw8IHN1bSAvIGNvdW50ICsgMSAqIChzdW0gJSBjb3VudCA+IGNvdW50IC8gMik7CglyZXR1cm4gMDsKfQ==