#include <iostream>
using namespace std;
int main() {
int quantity,force,count = 0,max = 0;
cin >> quantity;
while (cin >> force)
{
if (force > max)
{
max = force;
count = 1;
}
else if (force == max) count++;
}
cout << count;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgcXVhbnRpdHksZm9yY2UsY291bnQgPSAwLG1heCA9IDA7CgljaW4gPj4gcXVhbnRpdHk7Cgl3aGlsZSAoY2luID4+IGZvcmNlKQoJewoJCWlmIChmb3JjZSA+IG1heCkKCQl7CgkJCW1heCA9IGZvcmNlOwoJCQljb3VudCA9IDE7CgkJfQoJCWVsc2UgaWYgKGZvcmNlID09IG1heCkgY291bnQrKzsKCX0KCWNvdXQgPDwgY291bnQ7IAoJcmV0dXJuIDA7Cn0=