/**
 * Created by IntelliJ IDEA.
 * User: m09dao
 * Date: 07.10.2009
 * Time: 18:31:58
 * To change this template use File | Settings | File Templates.
 */
import java.io.*;
import java.util.*;
public class Sum {
     public static void main(String[] args) throws Exception{
       Scanner in=new Scanner(new File("sum.in"));
       PrintWriter out=new PrintWriter(new File("sum.out"));
       long n=in.nextInt();
       long a=n;
       int sum=0;
       while(a>=1)
       {
          a=a/10;
          sum+=n%10;
          n=n/10;
       }
       out.print(sum);
       in.close();
       out.close();
}
}
