#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
string str;
int ans = 0;
cin>>str;
for(int i = 0;i < str.size();++i) ans += str[i] - '0';
cout<<ans<<endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
string str;
int ans = 0;
cin>>str;
for(int i = 0;i < str.size();++i) ans += str[i] - '0';
cout<<ans<<endl;
return 0;
}