//package Contest081;

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int cnt =0; cnt 0 for(char x :str.toCharArray())
                if(x=='1')
                    cnt++; char x str.toCharArray() str.toCharArray str if(x=='1')
                    cnt++; if(x=='1')
                    cnt++; x=='1' x '1' cnt++ cnt out.println(cnt) out.println out cnt out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    }
} Main
//package Contest081;

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            String str = sc.nextLine();
            int cnt =0;
            for(char x :str.toCharArray())
                if(x=='1')
                    cnt++;
            out.println(cnt);
        out.flush();
    }
}
