#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) { return a < b ? a : b; }
int main() {
  long long n, cnt = 0;
  cin >> n;
  map<long long, long long> vis;
  while (vis[n] != 1) {
    vis[n] = 1;
    n++;
    cnt++;
    while (n % 10 == 0) {
      n /= 10;
    }
  }
  cout << cnt << endl;
  return 0;
}
