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