#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, i;
  cin >> n;
  long long cnt = 0;
  while (n >= 10) {
    n++;
    while (n % 10 == 0) {
      n = n / 10;
    }
    cnt++;
  }
  cout << cnt + 9 << endl;
}
