/**
 * Created by IntelliJ IDEA.
 * User: m09ega
 * Date: 07.10.2009
 * Time: 18:06:10
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
import java.io.*;

public class PrD {
    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=s+(n%10);
            n=n/10;
        }
        out.println(s);
        in.close();
        out.close();
    }
}
