#include<bits/stdc++.h>
using namespace std;
int x,s;
int main(){
cin>>x;
while(x!=0){
s=s+x%10;
x=x/10;
}
cout<<s;
return 0;
}
/**************************************************************
Problem: 1119
User: zhangziang
Language: C++
Result: Accepted
Time:7 ms
Memory:2072 kb
****************************************************************/