#include<bits/stdc++.h>
using namespace std;
int shu;
int he=0;
int main()
{
cin>>shu;
while(shu>0)
{
he=he+shu%10;
shu=shu/10;
}
cout<<he;
return 0;
}
/**************************************************************
Problem: 1960
User: admin
Language: C++
Result: Accepted
Time:9 ms
Memory:2072 kb
****************************************************************/