#include<iostream> using namespace std; string s; int main(){ cin>>s; cout<<s[0]-'0'+s[1]-'0'+s[2]-'0'<<endl; return 0; }