import java.util.Scanner;

public class Main {

      public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        
        int num = scan.nextInt();
          String str = Integer.toString(num); 
          
          int count = 0;
        char[] c = str.toCharArray();
        for(char c1 : c) {
            if(c1 == '1') {
            	count++;
            }
        }
          System.out.println(count);
        }

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

      public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        
        int num = scan.nextInt();
          String str = Integer.toString(num); 
          
          int count = 0;
        char[] c = str.toCharArray();
        for(char c1 : c) {
            if(c1 == '1') {
            	count++;
            }
        }
          System.out.println(count);
        }

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

      public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        
        int num = scan.nextInt();
          String str = Integer.toString(num); 
          
          int count = 0;
        char[] c = str.toCharArray();
        for(char c1 : c) {
            if(c1 == '1') {
            	count++;
            }
        }
          System.out.println(count);
        }

} public class Main {

      public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        
        int num = scan.nextInt();
          String str = Integer.toString(num); 
          
          int count = 0;
        char[] c = str.toCharArray();
        for(char c1 : c) {
            if(c1 == '1') {
            	count++;
            }
        }
          System.out.println(count);
        }

} Main
import java.util.Scanner;

public class Main {

      public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        
        int num = scan.nextInt();
          String str = Integer.toString(num); 
          
          int count = 0;
        char[] c = str.toCharArray();
        for(char c1 : c) {
            if(c1 == '1') {
            	count++;
            }
        }
          System.out.println(count);
        }

}