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

int main()
{
	char ch,copych[10000];
	int cnt, sum, num,a,b;
	cnt = 0;
	while (cin>>ch)
	{
		if ((ch>'0') && (ch<='9'))
		{
			copych[cnt] = ch;
			cnt++;	//numの桁数
		}
		
	}
	num = atoi(copych);
	sum = num % 10;
	for (int i = 1; i < cnt+1; i++)
	{
		a = num / pow(10.0, i);
		b = a % 10;
		sum += b;
	}
	cout << sum << endl;
	return 0;
}