function main(input) {
  const sss = input;
  let count = 0;
  for (let i = 0; i < sss.length; i++) {
    if (input[i] === "1") count++;
  }
  console.log(count);
}

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