#include<bits/stdc++.h>
using namespace std;
int main() {
	int n,j,a,h=0;
	cin>>n;
	j=n;
	while(j>0){
		a=j%10;
		j=j/10;
		h=h+a;
	}
	cout<<h;
}
/**************************************************************
	Problem: 1115
	User: linzihang
	Language: C++
	Result: Wrong Answer
****************************************************************/