import java.util.Scanner;

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

        for (int i=0; i<3; i++) {
            ans += (s % 10);
            s /= 10;
        }

        System.out.printf("%d\n", ans);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int ans = 0;

        for (int i=0; i<3; i++) {
            ans += (s % 10);
            s /= 10;
        }

        System.out.printf("%d\n", ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int ans = 0;

        for (int i=0; i<3; i++) {
            ans += (s % 10);
            s /= 10;
        }

        System.out.printf("%d\n", ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int ans = 0;

        for (int i=0; i<3; i++) {
            ans += (s % 10);
            s /= 10;
        }

        System.out.printf("%d\n", ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i=0; i<3; i++) {
            ans += (s % 10);
            s /= 10;
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            ans += (s % 10);
            s /= 10;
        } {
            ans += (s % 10);
            s /= 10;
        } ans += (s % 10) ans (s % 10) s 10 s /= 10 s 10 System.out.printf("%d\n", ans) System.out.printf System.out System System.out "%d\n" ans String[] args args
import java.util.Scanner;

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

        for (int i=0; i<3; i++) {
            ans += (s % 10);
            s /= 10;
        }

        System.out.printf("%d\n", ans);
    }
}