import java.util.*;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int cnt = 0;
        while(num != 0){
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        }
        System.out.println(cnt+"\n");
    }
} import java.util.*; util.* java class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int cnt = 0;
        while(num != 0){
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        }
        System.out.println(cnt+"\n");
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int cnt = 0;
        while(num != 0){
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        }
        System.out.println(cnt+"\n");
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int cnt = 0;
        while(num != 0){
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        }
        System.out.println(cnt+"\n");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 while(num != 0){
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        } num != 0 num 0 {
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        } if(num%10 == 1){cnt++ ;} num%10 == 1 num%10 num 10 1 {cnt++ ;} cnt++ cnt num = num/10 num num/10 num 10 System.out.println(cnt+"\n") System.out.println System.out System System.out cnt+"\n" cnt "\n" String args[] args
import java.util.*;

class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int cnt = 0;
        while(num != 0){
            if(num%10 == 1){cnt++ ;}
            num = num/10;
        }
        System.out.println(cnt+"\n");
    }
}