import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int sum = 0;
        for(int i = 0; i < str.length(); i++) {
            String xstr = str.substring(i, i + 1);
            int x = Integer.parseInt(xstr);
            sum += x;
        }
        System.out.println(sum);
    }
}