function Main(input) { var inp = input.split("\n"); inp = inp.map(x => parseInt(x)); const reducer = (a,b) => a+b; console.log(inp.reduce(reducer)); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));