function main(input) {
    var array = input.split('');
    var sum = array.reduce(function (acc, arg) {
        return acc + parseInt(arg, 10);
    }, 0);
    console.log(sum);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
