#include<iostream> using namespace std; int main(){ int z,b=0; cin>>z; do{ b = b+z%10; z=z/10; }while(z!=0); cout<<b; return 0; }