#include <iostream>
#include <vector>
using namespace std;
vector <string> split(string lines){
vector <string> words;
string word="";
for (int i=0; i<lines.size(); i++){
if (lines[i]=='.') break;
if (lines[i]!=' ') word+=lines[i];
else if (!word.empty()){
words.push_back(word);
word = "";
}
}
if (!word.empty()) words.push_back(word);
return words;
}
string includeA( vector <string> words){
int index = -1;
for (int i=0; i<words.size(); i++){
string word = words[i];
if ( word.find('a') < word.size() && index==-1) index = i;
else if ( words[i].find('a') < words[i].size() && words[i].size()>words[index].size() ) index = i;
}
if (index==-1) return "NO";
else return words[index];
}
int sums(string nums){
int s=0;
for (int i=0; i<nums.size(); i++) s += nums[i]-'0';
return s;
}
int main() {
string nums;
cin>>nums;
cout<<sums(nums);
return 0;
}