/**
 * Created by IntelliJ IDEA.
 * User: m09aaa
 * Date: 30.09.2009
 * Time: 17:27:57
 * To change this template use File | Settings | File Templates.
 */

/**
 * Created by IntelliJ IDEA.
 * User: m09aaa
 * Date: 30.09.2009
 * Time: 17:27:57
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
 import java.io.*;

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


