import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int counter = 0; counter 0 String temp = scanner.nextLine(); temp scanner.nextLine() scanner.nextLine scanner if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		} String.valueOf(temp.charAt(0)).equals("1") String.valueOf(temp.charAt(0)).equals String.valueOf(temp.charAt(0)) String.valueOf String temp.charAt(0) temp.charAt temp 0 "1" {
			counter++;
		} counter++ counter if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		} String.valueOf(temp.charAt(1)).equals("1") String.valueOf(temp.charAt(1)).equals String.valueOf(temp.charAt(1)) String.valueOf String temp.charAt(1) temp.charAt temp 1 "1" {
			counter++;
		} counter++ counter if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		} String.valueOf(temp.charAt(2)).equals("1") String.valueOf(temp.charAt(2)).equals String.valueOf(temp.charAt(2)) String.valueOf String temp.charAt(2) temp.charAt temp 2 "1" {
			counter++;
		} counter++ counter System.out.println(counter) System.out.println System.out System System.out counter scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);
		int counter = 0;

		String temp = scanner.nextLine();
		if(String.valueOf(temp.charAt(0)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(1)).equals("1")) {
			counter++;
		}
		if(String.valueOf(temp.charAt(2)).equals("1")) {
			counter++;
		}

		System.out.println(counter);

		scanner.close();


	}

}
