const reader = require("readline").createInterface({ input: process.stdin, output: process.stdout }); let lines = []; reader.on("line", line => { lines.push(line); }); reader.on("close", () => { let votes = lines[1].split(' ').map(str => parseInt(str, 10)).reduce((a, c) => a + c) const check = votes.filter(item => item <= sum / 10) console.log(30 * check.length) });