function main(input = ``) { let lines = input.split('\n'); return Array.from(lines[0]).reduce((sum, c) => { if (!isNaN(parseInt(c))) { return sum + parseInt(c); } else { return sum; } }, 0); } const { readFileSync, existsSync } = require('fs'); const stdin = '/dev/stdin'; if (existsSync(stdin)) { const input = readFileSync(stdin, 'utf8'); console.log(main(input)); } module.exports = main;