/**
 * Created by IntelliJ IDEA.
 * User: m09kaa3
 * Date: 07.10.2009
 * Time: 17:57:54
 * To change this template use File | Settings | File Templates.
 */
import java.io.*;
import java.util.*;
public class sumofint {
    public static void main(String[] args) throws Exception{
       Scanner s= new Scanner(new File("sum.in"));
        PrintWriter p= new PrintWriter(new File("sum.out"));
        int n=s.nextInt();
        int sum =0;

        for(int i=1;i<=10;i++){
            sum+= n%10;
            n= (n-n%10)/10;
        }
        p.print(sum);
        p.close();
    }
}
