function Main(input) {
	const lines = input.split("\n");
	const line1 = lines[0].split(" ");
  const answer = line1[0].split('').reduce((acc, s) =>  {
    return acc + (s === '1' ? 1 : 0);
  }, 0)
	console.log('%s',answer)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
