#include <iostream>
#include <cmath>
using namespace std;
int main() {
int N,S=0;
cin >> N;
N = abs(N);
while (N > 0) {
S += N % 10;
N /= 10;
}
cout << S;
return 0;
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int N,S=0;
cin >> N;
N = abs(N);
while (N > 0) {
S += N % 10;
N /= 10;
}
cout << S;
return 0;
}