#include <bits/stdc++.h>
using namespace std;
long long n, ss, c;
string s;
int main() {
  cin >> s;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] != '0')
      ss += s[i] - '0';
    else {
      c = i;
      while (s[c] == '0') c--;
      int x = i - c;
      ss = ss + (pow(10, x) * (s[c] - '0'));
      ss -= s[c] - '0';
    }
  }
  cout << ss + 1;
}
