import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();
        String s = Integer.toString(num);

        int counter = 0;

        for(int i = 0; i < s.length(); ++i){
            if(s.charAt(i) == '1') ++counter;
        }

        System.out.println(counter);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();
        String s = Integer.toString(num);

        int counter = 0;

        for(int i = 0; i < s.length(); ++i){
            if(s.charAt(i) == '1') ++counter;
        }

        System.out.println(counter);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();
        String s = Integer.toString(num);

        int counter = 0;

        for(int i = 0; i < s.length(); ++i){
            if(s.charAt(i) == '1') ++counter;
        }

        System.out.println(counter);
    } main {
        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();
        String s = Integer.toString(num);

        int counter = 0;

        for(int i = 0; i < s.length(); ++i){
            if(s.charAt(i) == '1') ++counter;
        }

        System.out.println(counter);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc String s = Integer.toString(num); s Integer.toString(num) Integer.toString Integer num int counter = 0; counter 0 for(int i = 0; i < s.length(); ++i){
            if(s.charAt(i) == '1') ++counter;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s ++i ++i i {
            if(s.charAt(i) == '1') ++counter;
        } {
            if(s.charAt(i) == '1') ++counter;
        } if(s.charAt(i) == '1') ++counter; s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' ++counter counter System.out.println(counter) System.out.println System.out System System.out counter String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int num = sc.nextInt();
        String s = Integer.toString(num);

        int counter = 0;

        for(int i = 0; i < s.length(); ++i){
            if(s.charAt(i) == '1') ++counter;
        }

        System.out.println(counter);
    }
}