// package app;

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.stream.Stream; Stream java.util.stream public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

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

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    } main {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String S = sc.next(); S sc.next() sc.next sc int cnt = 0; cnt 0 for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        } {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        } cnt += S.charAt(i) == '1' ? 1 : 0 cnt S.charAt(i) == '1' ? 1 : 0 S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' 1 0 System.out.println(cnt) System.out.println System.out System System.out cnt final String[] args args public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
} Main
// package app;

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        final String S = sc.next();
        // final int M = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        // final int D = sc.nextInt();

        int cnt = 0;
        for (int i = 0; i < S.length(); i++) {
            cnt += S.charAt(i) == '1' ? 1 : 0;
        }
        // System.out.println();
        System.out.println(cnt);

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
}