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");
		int n = in.nextInt();
		int s =0;
		while(n>0){
			s+=n%10;
			n=n/10;
		
		}
		out.print(s);
		out.close();
		in.close();
		
}
}
