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

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