#include<bits/stdc++.h>
using namespace std;
int main() {
int a,b,e,f,g,h;
cin>>a;
b=a/1000;
g=a/100%10;
e=a/10%10;
f=a%10;
h=a+b+e+f+g;
cout<<h;
return 0;
}
/**************************************************************
Problem: 1617
User: panyuchen
Language: C++
Result: Accepted
Time:9 ms
Memory:2072 kb
****************************************************************/