#include <stdio.h>
int main(){
int n,a,b;
int sum=0;
scanf("%d",&n);
while(n/10!=0){
a=n%10;
sum+=a;
n/=10;
}
sum+=n;
printf("%d",sum);
return 0;
}
int main(){
int n,a,b;
int sum=0;
scanf("%d",&n);
while(n/10!=0){
a=n%10;
sum+=a;
n/=10;
}
sum+=n;
printf("%d",sum);
return 0;
}