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