#include <bits/stdc++.h>
using namespace std;
int n, dem;
int main() {
  cin >> n;
  if (n % 10 == 0) {
    n++;
    dem++;
  }
  while (n >= 10) {
    while (n % 10 != 0) {
      n++;
      dem++;
    }
    while (n % 10 == 0) n /= 10;
  }
  cout << dem + 9;
}
