#include<bits/stdc++.h>
using namespace std;
 int main(){
    int x,b,c,d,z;
    cin>>x;
    b=x%10;
    c=(x/10)%10;
    d=x/100;
    z=b+c+d; 
    cout<<z;
    return 0;
 } 
/**************************************************************
	Problem: 1027
	User: binzicheng1
	Language: C++
	Result: Accepted
	Time:9 ms
	Memory:2072 kb
****************************************************************/