#include <bits/stdc++.h>
using namespace std;
long long n;
map<long long, int> mp;
long long solve(long long x) {
  while (n % 10 == 0) {
    n /= 10;
  }
  return n;
}
int main() {
  cin >> n;
  long long ans = 1;
  mp[n] = 1;
  while (1) {
    n++;
    n = solve(n);
    if (mp[n] == 0)
      ans++;
    else
      break;
    mp[n] = 1;
  }
  cout << ans << endl;
}
