#include <bits/stdc++.h>
long long int lcm, k, ans, a, b;
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  mp[n] = 1;
  n++;
  int c = 1;
  while (1) {
    if (mp[n] == 1 && n % 10 != 0)
      break;
    else {
      if (n % 10 == 0) {
        while (n % 10 == 0) n /= 10;
      } else {
        mp[n] = 1;
        n++;
        c++;
      }
    }
  }
  cout << c << '\n';
  return 0;
}
