import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	} main {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String st = scan.nextLine(); st scan.nextLine() scan.nextLine scan int ans = 0; ans 0 for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		} {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		} char ch = st.charAt(i); ch st.charAt(i) st.charAt st i if (ch == '1') {
				ans += 1;
			} ch == '1' ch '1' {
				ans += 1;
			} ans += 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		String st = scan.nextLine();
		int ans = 0;
		for (int i = 0; i < 3; i++) {
			char ch = st.charAt(i);
			if (ch == '1') {
				ans += 1;
			}
		}
		System.out.println(ans);
	}

}
