#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int lcm(int a, int b) { return ((a * b) / gcd(b, a % b)); }
int n, k, i, t, kk, a[100010];
int main() {
  int n;
  cin >> n;
  int ans = 0;
  while (n >= 10) {
    ans++;
    n++;
    while (n % 10 == 0 && n != 0) {
      n /= 10;
    }
  }
  cout << ans + 9 << endl;
  return 0;
}
