import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

} Main public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} int count = 0; count 0 String square =  br.readLine(); square br.readLine() br.readLine br for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				if(square.charAt(i) == '1') {
					count++;
				}
			} {
				if(square.charAt(i) == '1') {
					count++;
				}
			} if(square.charAt(i) == '1') {
					count++;
				} square.charAt(i) == '1' square.charAt(i) square.charAt square i '1' {
					count++;
				} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

} public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = 0;
			String square =  br.readLine();

			for(int i = 0; i < 3; i++) {
				if(square.charAt(i) == '1') {
					count++;
				}
			}

			System.out.println(count);
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
