#include<iostream>
using namespace std;

int solve(int n){
  if(n%10==0)return 10;
  int res=0;
  while(n){
    res+=n%10;
    n/=10;
  }
  return res;
}

int main(){
  int n;
  cin>>n;
  cout<<solve(n)<<endl;
}
