function main(input) {
  const args = input.split(" ");
  const sss = args[0];
  let count = 0;
  sss.split("").forEach(c => {
    if (c === "1") {
      count++
    }
  });
  console.log(count);
}

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