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