function main(input) {
	const arr = input.split('');
  	let cnt = 0;
	for (let i = 0; i < arr.length; i++) {
      if (arr[i] === '1') {
        cnt++;
      }
    }
  	console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));