#include<iostream> using namespace std; int main(){int a,b,c,d; cin>>d; a=int(d/100); c=d%10; b=(d-100*a-c)/10; cout<<a+b+c; return 0; }