#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int res = 0;
    while(n)
    {
        res += n % 10;
        n /= 10;
    }

    if(1 == res)
    {
        res *= 10;
    }

    cout << res << endl;

    return 0;
}
