function processData(input) { //Enter your code here input = input.split('\n')[1].split(' ').map(function(el){return +el}); var max = Math.max.apply(null, input); console.log(input.filter(function(el){ return el === max }).length) } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });