import java.util.*;

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

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

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

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int count = 0; count 0 for(String value : s.split("")) {
			if(value.equals("1")) count++;
		} String value s.split("") s.split s "" {
			if(value.equals("1")) count++;
		} {
			if(value.equals("1")) count++;
		} if(value.equals("1")) count++; value.equals("1") value.equals value "1" count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static void print(Object o) {
		System.out.print(o);
	} print {
		System.out.print(o);
	} System.out.print(o) System.out.print System.out System System.out o Object o o public static void println(Object o) {
		System.out.println(o);
	} println {
		System.out.println(o);
	} System.out.println(o) System.out.println System.out System System.out o Object o o public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

	}

	public static void print(Object o) {
		System.out.print(o);
	}

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

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
} Main
import java.util.*;

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

		String s = sc.next();

		int count = 0;
		for(String value : s.split("")) {
			if(value.equals("1")) count++;
		}

		System.out.println(count);

	}

	public static void print(Object o) {
		System.out.print(o);
	}

	public static void println(Object o) {
		System.out.println(o);
	}
}