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