import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] numberArray = sc.next().split(""); numberArray sc.next().split("") sc.next().split sc.next() sc.next sc "" int answer = 0; answer 0 for(String number :numberArray) {
			answer += Integer.valueOf(number);
		} String number numberArray {
			answer += Integer.valueOf(number);
		} {
			answer += Integer.valueOf(number);
		} answer += Integer.valueOf(number) answer Integer.valueOf(number) Integer.valueOf Integer number System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] numberArray = sc.next().split("");
		int answer = 0;
		for(String number :numberArray) {
			answer += Integer.valueOf(number);
		}
		System.out.println(answer);
	}
}