#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
long long n,q;
int main()
{
	scanf("%lld",&n);
	long long ans=0;
	int pd=0;
	while(n)
	{
		if(n%10) pd++;
		ans+=n%10;
		n/=10;

	}
	if(pd<2) ans*=10;
	printf("%lld\n",ans);
	return 0;
}