import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;

public class Main {

	static Deque<Integer> stack = new ArrayDeque<>();
	static ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();

	static int count = 0;
	static int n;

	static boolean flag = false;

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Deque; Deque java.util public class Main {

	static Deque<Integer> stack = new ArrayDeque<>();
	static ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();

	static int count = 0;
	static int n;

	static boolean flag = false;

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main static Deque<Integer> stack = new ArrayDeque<>(); stack new ArrayDeque<>() static ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>(); list new ArrayList<ArrayList<Integer>>() static int count = 0; count 0 static int n; n static boolean flag = false; flag false public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(""); str br.readLine().split("") br.readLine().split br.readLine() br.readLine br "" int count = 0; count 0 for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if(str[i].equals("1")) {
				count++;
			}
		} {
			if(str[i].equals("1")) {
				count++;
			}
		} if(str[i].equals("1")) {
				count++;
			} str[i].equals("1") str[i].equals str[i] str i "1" {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args public class Main {

	static Deque<Integer> stack = new ArrayDeque<>();
	static ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();

	static int count = 0;
	static int n;

	static boolean flag = false;

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {

	static Deque<Integer> stack = new ArrayDeque<>();
	static ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();

	static int count = 0;
	static int n;

	static boolean flag = false;

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;

public class Main {

	static Deque<Integer> stack = new ArrayDeque<>();
	static ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();

	static int count = 0;
	static int n;

	static boolean flag = false;

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");
		int count = 0;
		for (int i = 0; i < str.length; i++) {
			if(str[i].equals("1")) {
				count++;
			}
		}
		System.out.println(count);
	}
}