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