#include <bits/stdc++.h>
using namespace std;
string is(long long int num) {
  stringstream ss;
  ss << num;
  return ss.str();
}
long long int si(string s) {
  stringstream geek(s);
  long long int x = 0;
  geek >> x;
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  cin >> s;
  long long int i, n;
  n = si(s);
  long long int res = 0;
  while (n / 10 != 0) {
    n++;
    res++;
    s = is(n);
    for (i = s.length() - 1; i >= 0; i--) {
      if (s[i] != '0') break;
    }
    s = s.substr(0, i + 1);
    n = si(s);
  }
  cout << res + 9;
  return 0;
}
