process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

var memo = {};

function Main(input) {

    var employed = 0;
    for (var i = 0; i < input[0].length; i++) {
        if (input[0][i] == '1') {
            employed++;
        }
    }

    console.log(employed);

    return 0;
}