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