#include<bits/stdc++.h>
using namespace std;
int main(){
int x,s,g,sh,b,q,w;
cin>>x;
g=x%10;
sh=x/10%10;
b=x/100%10;
q=x/1000%10;
w=x/10000;
s=g+sh+b+q+w;
cout<<s;
}
/**************************************************************
Problem: 1418
User: huanglingkai
Language: C++
Result: Accepted
Time:12 ms
Memory:2072 kb
****************************************************************/