#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
void solve() {
  int n;
  cin >> n;
  int ans = 0;
  bool b = true;
  while (n != 0) {
    if (n >= 1 and n <= 9) {
      ans += 10;
      break;
    }
    ans += (10 - n % 10);
    n = (n - n % 10 + 10);
    if (n % 10 == 0) {
      while (n % 10 == 0) {
        n /= 10;
      }
    }
  }
  cout << ans - 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  int t;
  t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
