import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	}
} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	} main {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String s = stdIn.next(); s stdIn.next() stdIn.next stdIn int ans = 0; ans 0 for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(s.charAt(i) == '1') {
				ans++;
			}
		} {
			if(s.charAt(i) == '1') {
				ans++;
			}
		} if(s.charAt(i) == '1') {
				ans++;
			} s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
				ans++;
			} ans++ ans System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	}
} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String s = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++) {
			if(s.charAt(i) == '1') {
				ans++;
			}
		}
		System.out.print(ans);
	}
}