#include <bits/stdc++.h>
using namespace std;
int a[1000000], cnt = 1;
int main() {
  int n;
  cin >> n;
  if (n < 10) {
    cout << 9;
    return 0;
  }
  while (1) {
    n++;
    while (n % 10 == 0) {
      n /= 10;
    }
    cnt++;
    if (n < 10) {
      cnt += 8;
      break;
    }
  }
  cout << cnt;
  return 0;
}
