#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  map<long long, bool> mapa;
  while (n) {
    if (mapa[n]) break;
    mapa[n]++;
    n++;
    if (!(n % 10))
      while (!(n % 10)) n /= 10;
  }
  cout << int(mapa.size()) << "\n";
  return 0;
}
