#include <bits/stdc++.h>
using namespace std;
int a[200000];
int main() {
  int i, j, m, n, s, w, k;
  while (~scanf("%d", &n)) {
    if (n >= 10)
      s = 1;
    else
      s = 0;
    while (n >= 10) {
      w = n % 10;
      s += 9 - w;
      n = n / 10;
    }
    s = s + 9;
    printf("%d\n", s);
  }
  return 0;
}
