#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int test(int x)
{
int n = 0;
int sum = 0;
if (x != 0)
{
n = x % 10;
x = x / 10;
sum = n + test(x);
}
return sum;
}
int main()
{
int x = 0;
int ret = 0;
scanf("%d", &x);
ret=test(x);
printf("%d", ret);
system("pause");
return 0;
}