import java.util.Scanner;

public class Main {

	private static Scanner sc;

	public static void main(String[] args) {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	}

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

	private static Scanner sc;

	public static void main(String[] args) {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	}

} Main private static Scanner sc; sc public static void main(String[] args) {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	} main {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	} sc = new Scanner(System.in) sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc int count = 0; count 0 if (str.substring(0,1).contentEquals("1")) count+=1; str.substring(0,1).contentEquals("1") str.substring(0,1).contentEquals str.substring(0,1) str.substring str 0 1 "1" count+=1 count 1 if (str.substring(1,2).contentEquals("1")) count+=1; str.substring(1,2).contentEquals("1") str.substring(1,2).contentEquals str.substring(1,2) str.substring str 1 2 "1" count+=1 count 1 if (str.substring(2,3).contentEquals("1")) count+=1; str.substring(2,3).contentEquals("1") str.substring(2,3).contentEquals str.substring(2,3) str.substring str 2 3 "1" count+=1 count 1 System.out.print(count) System.out.print System.out System System.out count String[] args args public class Main {

	private static Scanner sc;

	public static void main(String[] args) {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	}

} public class Main {

	private static Scanner sc;

	public static void main(String[] args) {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	}

} Main
import java.util.Scanner;

public class Main {

	private static Scanner sc;

	public static void main(String[] args) {

		sc = new Scanner(System.in);
		String str = sc.next();
		int count = 0;

		if (str.substring(0,1).contentEquals("1")) count+=1;
		if (str.substring(1,2).contentEquals("1")) count+=1;
		if (str.substring(2,3).contentEquals("1")) count+=1;

		System.out.print(count);
	}

}
