import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    }
} Main public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.nextLine(); str scan.nextLine() scan.nextLine scan int count = 0; count 0 for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    } char c str.toCharArray() str.toCharArray str {
	    	if(c == '1'){
		    	count++;
		    }
	    } {
	    	if(c == '1'){
		    	count++;
		    }
	    } if(c == '1'){
		    	count++;
		    } c == '1' c '1' {
		    	count++;
		    } count++ count System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        int count = 0;
        
    	for(char c: str.toCharArray()){
	    	if(c == '1'){
		    	count++;
		    }
	    }
        
        System.out.println(count);
        scan.close();
    }
}
