#include <bits/stdc++.h>

using namespace std;
using ll=long long;

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