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