#include<bits/stdc++.h>
using namespace std;
int main(){
int n,j,a=0,h=0;
cin>>n;
j=n;
while(j>0){
a=j%10;
j=j/10;
h=h+a;
}
cout<<h;
}
/**************************************************************
Problem: 1119
User: linzihang
Language: C++
Result: Accepted
Time:9 ms
Memory:2072 kb
****************************************************************/