//c++
#include <iostream>
using namespace std;
int main()
{
int x,s = 0;
cin >> x;
x = abs(x);
while (x > 0){
s += x % 10;
x/=10;
}
cout << s;
return 0;
//c++
#include <iostream>
using namespace std;
int main()
{
int x,s = 0;
cin >> x;
x = abs(x);
while (x > 0){
s += x % 10;
x/=10;
}
cout << s;
return 0;
}