#include <iostream>
using namespace std;
int main()
{
int n, sumaDig=0;
cin >> n;
while(n>0){
sumaDig = sumaDig + (n%10);
n = n / 10;
}
cout << sumaDig;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKaW50IG1haW4oKQp7CiAgICBpbnQgbiwgc3VtYURpZz0wOwogICAgY2luID4+IG47CiAgICB3aGlsZShuPjApewogICAgICAgIHN1bWFEaWcgPSBzdW1hRGlnICsgKG4lMTApOwogICAgICAgIG4gPSBuIC8gMTA7CiAgICB9CiAgICBjb3V0IDw8IHN1bWFEaWc7CiAgICByZXR1cm4gMDsKIAp9