import java.util.*;
public class Main {
	public static void main(String[] args) {
		A();
	}
	
	public static void A() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	}
	
	//0...M   2^M > 最小の要素 の範囲で 2^kで全て割り切れるかで２分探索 O(Nloglogminval)
	// 0...Mまで順に確かめると、O(Nlogminval)
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		A();
	}
	
	public static void A() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	}
	
	//0...M   2^M > 最小の要素 の範囲で 2^kで全て割り切れるかで２分探索 O(Nloglogminval)
	// 0...Mまで順に確かめると、O(Nlogminval)
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	}
} Main public static void main(String[] args) {
		A();
	} main {
		A();
	} A() A String[] args args public static void A() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	} A {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc int ret  = 0; ret 0 for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			ret += Character.getNumericValue(s.charAt(i));
		} {
			ret += Character.getNumericValue(s.charAt(i));
		} ret += Character.getNumericValue(s.charAt(i)) ret Character.getNumericValue(s.charAt(i)) Character.getNumericValue Character s.charAt(i) s.charAt s i System.out.println(ret) System.out.println System.out System System.out ret //0...M   2^M > 最小の要素 の範囲で 2^kで全て割り切れるかで２分探索 O(Nloglogminval)
	// 0...Mまで順に確かめると、O(Nlogminval)
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	} B {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] A = new int[N]; A new int[N] N for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			A[i] = sc.nextInt();
  		} {
			A[i] = sc.nextInt();
  		} A[i] = sc.nextInt() A[i] A i sc.nextInt() sc.nextInt sc int maxdo = -1; maxdo -1 1 boolean cansep = true; cansep true while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		} cansep {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		} maxdo++ maxdo for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			} int j=0; int j=0; j 0 j<A.length j A.length A A.length j++ j++ j {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			} {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			} int sep = (int) Math.pow(2, maxdo); sep (int) Math.pow(2, maxdo) Math.pow Math 2 maxdo if(A[j]%sep != 0) {
					cansep = false;
					break;  
				} A[j]%sep != 0 A[j]%sep A[j] A j sep 0 {
					cansep = false;
					break;  
				} cansep = false cansep false break; System.out.println(maxdo-1) System.out.println System.out System System.out maxdo-1 maxdo 1 public class Main {
	public static void main(String[] args) {
		A();
	}
	
	public static void A() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	}
	
	//0...M   2^M > 最小の要素 の範囲で 2^kで全て割り切れるかで２分探索 O(Nloglogminval)
	// 0...Mまで順に確かめると、O(Nlogminval)
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	}
} public class Main {
	public static void main(String[] args) {
		A();
	}
	
	public static void A() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	}
	
	//0...M   2^M > 最小の要素 の範囲で 2^kで全て割り切れるかで２分探索 O(Nloglogminval)
	// 0...Mまで順に確かめると、O(Nlogminval)
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		A();
	}
	
	public static void A() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		int ret  = 0;
		for(int i=0;i<s.length();i++) {
			ret += Character.getNumericValue(s.charAt(i));
		}
		System.out.println(ret);
	}
	
	//0...M   2^M > 最小の要素 の範囲で 2^kで全て割り切れるかで２分探索 O(Nloglogminval)
	// 0...Mまで順に確かめると、O(Nlogminval)
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for(int i=0;i<N;i++) {
			A[i] = sc.nextInt();
  		}
		int maxdo = -1;
		boolean cansep = true;
		while(cansep) {
			maxdo++;
			for(int j=0;j<A.length;j++) {
				int sep = (int) Math.pow(2, maxdo);
				if(A[j]%sep != 0) {
					cansep = false;
					break;  
				}
			}
		}
		System.out.println(maxdo-1);
	}
}