import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	}

	private String getParameter() {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	}

	private void outputAnswer(String answer) {
		System.out.println(answer);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	}

	private String getParameter() {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	}

	private void outputAnswer(String answer) {
		System.out.println(answer);
	}
} Main public static void main(String[] args) {
		new Main().execute();
	} main {
		new Main().execute();
	} new Main().execute() new Main().execute new Main() String[] args args private void execute() {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	} execute {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	} String initString = getParameter(); initString getParameter() getParameter int count = 0; count 0 int index = 0; index 0 for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		} ; index < initString.length() index initString.length() initString.length initString index++ index++ index {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		} {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		} if ('1' == (initString.charAt(index))) {
				count++;
			} '1' == (initString.charAt(index)) '1' (initString.charAt(index)) initString.charAt initString index {
				count++;
			} count++ count outputAnswer(String.valueOf(count)) outputAnswer String.valueOf(count) String.valueOf String count private String getParameter() {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	} getParameter {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String ret = scan.next(); ret scan.next() scan.next scan scan.close() scan.close scan return ret; ret private void outputAnswer(String answer) {
		System.out.println(answer);
	} outputAnswer {
		System.out.println(answer);
	} System.out.println(answer) System.out.println System.out System System.out answer String answer answer public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	}

	private String getParameter() {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	}

	private void outputAnswer(String answer) {
		System.out.println(answer);
	}
} public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	}

	private String getParameter() {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	}

	private void outputAnswer(String answer) {
		System.out.println(answer);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().execute();
	}

	private void execute() {

		String initString = getParameter();

		int count = 0;
		int index = 0;

		for (; index < initString.length(); index++) {
			if ('1' == (initString.charAt(index))) {
				count++;
			}
		}

		outputAnswer(String.valueOf(count));
	}

	private String getParameter() {

		Scanner scan = new Scanner(System.in);

		String ret = scan.next();

		scan.close();

		return ret;
	}

	private void outputAnswer(String answer) {
		System.out.println(answer);
	}
}
