#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  int N; cin >> N;
  int tmp = N;
  int ans = 0;
  while(tmp > 0){
    ans+= tmp%10;
    tmp /= 10;
  }
  
  cout << (ans == 1?10:ans) << endl;
}