#include<iostream>
#include<stdlib.h>
#include<cstring>
#include<iostream>
#include<stdio.h>
using namespace std;

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

