#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, sum = 0, final = 0;
  cin >> n;
  if (n >= 1 && n <= 9)
    cout << 9 << endl;
  else {
    int flag = 0, flag1 = 0;
    while (1) {
      sum = 10 - (n % 10);
      final += sum;
      n = n + sum;
      int n1 = n, c = 0;
      while (n % 10 == 0) n = n / 10;
      if (n >= 1 && n <= 9) break;
    }
    cout << final + 9 << endl;
  }
}
