#include using namespace std; int main(){ int S; cin >> S; int ans = 0; while(S>0){ ans += S%10; S /= 10; } cout << ans << endl; return 0; }