import java.util.Scanner;

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

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc char[] str = new char[n.length()]; str new char[n.length()] n.length() n.length n int count = 0; count 0 for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		} int i = 0; int i = 0; i 0 i < n.length() i n.length() n.length n i++ i++ i {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		} {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		} String tmp = String.valueOf(n.charAt(i)); tmp String.valueOf(n.charAt(i)) String.valueOf String n.charAt(i) n.charAt n i if (tmp.equals("1")) {
				count++;
			} tmp.equals("1") tmp.equals tmp "1" {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	}
} Main
import java.util.Scanner;

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

		String n = sc.next();

		char[] str = new char[n.length()];

		int count = 0;
		for (int i = 0; i < n.length(); i++) {
			String tmp = String.valueOf(n.charAt(i));

			if (tmp.equals("1")) {
				count++;
			}
		}

		// 出力
		System.out.println(count);
	}
}