import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int sum = 0; sum 0 int t = N; t N while(t>0) {
			sum += t%10;
			t=t/10;
		} t>0 t 0 {
			sum += t%10;
			t=t/10;
		} sum += t%10 sum t%10 t 10 t=t/10 t t/10 t 10 System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int sum = 0;
		int t = N;
		while(t>0) {
			sum += t%10;
			t=t/10;
		}
		System.out.println(sum);
		sc.close();
	}
}