function Main(input) { let num = input.replace(/[^0-9]/g, ''); let array = num.split('').map(Number); let sum = array.reduce((a,b)=>a+b); console.log(sum); } Main(require("fs").readFileSync("/dev/stdin", "utf8"));