#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int v[10000], val = 1;
  cin >> n;
  v[1] = n;
  bool ok = true;
  while (ok) {
    n++;
    while (n % 10 == 0) n = n / 10;
    for (int i = 1; i <= val; i++)
      if (v[i] == n) {
        cout << val;
        return 0;
      }
    v[++val] = n;
  }
  return 0;
}
