import java.util.Scanner;
     
class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        
        System.out.println(calc(S));
        
    }
    
    public static int calc(String S) {
    	String[] s = S.split("");
    	int count = 0;
    	for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        }
    	return count;
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        
        System.out.println(calc(S));
        
    }
    
    public static int calc(String S) {
    	String[] s = S.split("");
    	int count = 0;
    	for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        }
    	return count;
    }
} Main public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        
        System.out.println(calc(S));
        
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        
        System.out.println(calc(S));
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc sc.close() sc.close sc System.out.println(calc(S)) System.out.println System.out System System.out calc(S) calc S String arg[] arg public static int calc(String S) {
    	String[] s = S.split("");
    	int count = 0;
    	for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        }
    	return count;
    } calc {
    	String[] s = S.split("");
    	int count = 0;
    	for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        }
    	return count;
    } String[] s = S.split(""); s S.split("") S.split S "" int count = 0; count 0 for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        } int i = 0; int i = 0; i 0 i < 3 i 3 i ++ i ++ i {
        	if(s[i].equals("1")) {
        		count++;
        	}
        } {
        	if(s[i].equals("1")) {
        		count++;
        	}
        } if(s[i].equals("1")) {
        		count++;
        	} s[i].equals("1") s[i].equals s[i] s i "1" {
        		count++;
        	} count++ count return count; count String S S
import java.util.Scanner;
     
class Main{
    public static void main(String arg[]) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();
        
        System.out.println(calc(S));
        
    }
    
    public static int calc(String S) {
    	String[] s = S.split("");
    	int count = 0;
    	for(int i = 0; i < 3; i ++) {
        	if(s[i].equals("1")) {
        		count++;
        	}
        }
    	return count;
    }
}