#include<bits/stdc++.h> using namespace std; int main(){ int a,cum=0; cin>>a; while(a>0){ cum+=a%10; a/=10; } cout<<cum<<endl; return 0; }