#include <bits/stdc++.h>
using namespace std;
long int foo(long int num) {
  num += 1;
  while (num % 10 == 0) num /= 10;
  return num;
}
int main() {
  long int num;
  set<long int> st;
  cin >> num;
  st.insert(num);
  num = foo(num);
  while (st.find(num) == st.end()) {
    st.insert(num);
    num = foo(num);
  }
  cout << st.size() << endl;
}
