#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 7;
int main() {
  int i, n, m, j, k, l, ans = 1;
  scanf("%d", &n);
  n++;
  if (n - 1 < 10) {
    printf("9\n");
    return 0;
  }
  while (1) {
    if (n < 10) {
      ans = ans + 9;
      break;
    }
    if (n % 10 != 0) {
      ans = ans + 10 - n % 10;
      n = n / 10;
      n++;
    } else {
      n = n / 10;
    }
  }
  printf("%d\n", ans);
}
