#include"iostream"
using namespace std;

int main()
{
	int n;
	cin >> n;
	int sum = 0;
	for (int i = 0; i < 8; i++)
	{
		sum += n - (n / 10) * 10;
		n = n / 10;
	}
	cout << (sum == 1 ? 10 : sum) << endl;
}