#include <bits/stdc++.h>
using namespace std;
int n;
unordered_map<int, bool> mark;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  while (mark[n] == false) {
    mark[n] = true;
    n++;
    while (n % 10 == 0) n /= 10;
  }
  cout << mark.size();
  return 0;
}
