#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n;
  int steps = 0;
  cin >> n;
  while (1) {
    if (n / 10 == 0) {
      steps += 9;
      break;
    }
    steps += 10 - (n % 10);
    n += 10 - (n % 10);
    while (n % 10 == 0) {
      n /= 10;
    }
  }
  cout << steps;
}
