#include <bits/stdc++.h>
using namespace std;
int main() {
  map<int, int> mp;
  int x, c = 0;
  cin >> x;
  while (1) {
    mp[x] = 1;
    x++;
    while (x > 0 && x % 10 == 0) {
      x = x / 10;
    }
    c++;
    if (mp[x] == 1) {
      break;
    }
  }
  cout << c << endl;
  return 0;
}
