function Main(input) {
    input = input.split("\n");
    tmp = input[0].split(" ");
    res = tmp[0].match(/1/g).length;

    console.log(`${res}`);

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));