import java.util.Scanner;
public class jisuan
{ public static int sum(long n){
int sum=0;
while(n>0){
int m=(int)(n%10);
sum=sum+m;
n=n/10;
}
return sum;
} public static void main(String[] args){
try{
System.out.println("请输入数字:");
Scanner sc=new Scanner(System.in);
long l=sc.nextLong();
System.out.println(+sum(l));
}catch(Exception e){
}
}
}