#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

int main(){
	int n, ans; scanf( "%d", &n );
	if( n % 10 == 0 ) return puts( "10" ), 0;
	for( ans = 0; n; n /= 10 ) ans += n % 10;
	printf( "%d\n", ans );
	return 0;
}