function Main(input) {
  var r = 0;
  const s = input.toString();
  if (s[0] === '1') r++;
  if (s[1] === '1') r++;
  if (s[2] === '1') r++;
  console.log(r);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));