import java.util.Scanner;

public class Main {

	public static void main(String... nui) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	}

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

	public static void main(String... nui) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	}

} Main public static void main(String... nui) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int cnt = 0; cnt 0 if (s.charAt(0) == '1') cnt++; s.charAt(0) == '1' s.charAt(0) s.charAt s 0 '1' cnt++ cnt if (s.charAt(1) == '1') cnt++; s.charAt(1) == '1' s.charAt(1) s.charAt s 1 '1' cnt++ cnt if (s.charAt(2) == '1') cnt++; s.charAt(2) == '1' s.charAt(2) s.charAt s 2 '1' cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String... nui nui public class Main {

	public static void main(String... nui) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	}

} public class Main {

	public static void main(String... nui) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String... nui) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int cnt = 0;
		
		if (s.charAt(0) == '1') cnt++;
		if (s.charAt(1) == '1') cnt++;
		if (s.charAt(2) == '1') cnt++;
		
		System.out.println(cnt);
	}

}
