#include #include using namespace std; int main(){ string buf; cin >> buf; int sum = 0; int p = 0; while(1){ if (buf[p] == '\0'){ break; } sum += buf[p]- '0'; p++; } cout << sum << endl; }