import java.io.*;
import java.util.*;
/**
 * Created by IntelliJ IDEA.
 * User: m09aya
 * Date: 07.10.2009
 * Time: 17:19:23
 * To change this template use File | Settings | File Templates.
 */
public class P {
    public static void main (String[]args) throws Exception {
                   Scanner s = new Scanner (new File ("sum.in"));
                   PrintWriter p = new PrintWriter (new File ("sum.out"));
        long n = s.nextInt();
        long m = 0;
        while (n!=0){
                       m= m+n%10;
                       n=n/10;
              }
        p.print(m);
        s.close();
        p.close();
    }
}
