#include<iostream>
#include<stdio.h>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
    int N,sum=0;
    cin>>N;
    while(N)
    {
        sum+=N%10;
        N=N/10;
    }
    if(sum==1)
    sum=sum*10;
    cout<<sum<<endl;
    return 0;
}