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