#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	int a;
	char t;
	
	a=0;
	
	
	cin>>t;
	for(;int(t)!=48;){
		a=a+int(t);
		cin>>t;
	}
	
	cout<<a;
	
	return 0;
	
}
