import java.util.*;
import java.io.*;
public class s1 {
public static void main(String [] args) throws Exception
{
Scanner in=new Scanner(new File(("sum.in")));
PrintWriter out=new PrintWriter(new File("sum.out"));
int ch=in.nextInt();
int sum=0;
 while (ch>0)
 {
 int i=ch%10;
     sum+=i;
     ch=(ch-i)/10;
 }
    out.print(sum);
in.close();
out.close();
}
}

