import java.util.*;
import java.io.*;


public class Sum {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(new File("sum.in"));
		PrintWriter out = new PrintWriter("sum.out");
		long n = in.nextLong();
		long s = 0;
		while(n > 0){
			s = s + n % 10;
			n = n/10;
		}
		out.println(s);
		out.close();
		in.close();
		
	}

}
