#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n , s = 0 ;
    cin>>n;
    
	while( n > 0 )
	{
	    s += n % 10 ;
	    n /= 10;
	}
	
	if ( s==1 )
	{
	    cout<<10<<endl;
	}
	else 
	{
	    cout<<s<<endl;
	}
}