import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		}
	} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		}
	} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String[] sl = s.split(""); sl s.split("") s.split s "" int c = 0; c 0 for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} int i = 0; int i = 0; i 0 i < sl.length i sl.length sl sl.length i++ i++ i {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} if (sl[i].equals("1")) {
				c += 1;
			} sl[i].equals("1") sl[i].equals sl[i] sl i "1" {
				c += 1;
			} c += 1 c 1 System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		}
	} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		}
	} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String[] sl = s.split("");
		int c = 0;
		for (int i = 0; i < sl.length; i++) {
			if (sl[i].equals("1")) {
				c += 1;
			}
		} System.out.println(c);

		}
	}