#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ite = 0;
  scanf("%d", &n);
  int c = n;
  if (n % 10 == 0) n++, ite++;
  while (n > 10) {
    while (n % 10 == 0) n /= 10;
    if (n <= 10) break;
    ite += (10 - (n % 10));
    n += (10 - (n % 10));
  }
  ite += 9;
  printf("%d", ite);
  return 0;
}
