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