const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.question('', (input) => { const sumOfDigits = [...input].filter(c => c <= '9').reduce((sum, c) => sum + parseInt(c, 10), 0); console.log(sumOfDigits); rl.close(); });