#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int modulo(long long int a, long long int b) {
  long long int r = a % b;
  return r < 0 ? r + b : r;
}
long long int longrem(string k) {
  long long int now = 0;
  for (int i = 0; i < k.size(); i++) {
    now = (now * 10);
    now = (now + k[i] - '0');
  }
  return now;
}
long long int ncr(long long int n, long long int k) {
  long long int res = 1;
  if (k > n - k) k = n - k;
  for (long long int i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
long long int binaryToDecimal(long long int n) {
  long long int num = n;
  long long int dec_value = 0;
  long long int base = 1;
  long long int temp = num;
  while (temp) {
    long long int last_digit = temp % 10;
    temp = temp / 10;
    dec_value += last_digit * base;
    base = base * 2;
  }
  return dec_value;
}
void decToBinary(int n) {
  int binaryNum[32];
  int i = 0;
  while (n > 0) {
    binaryNum[i] = n % 2;
    n = n / 2;
    i++;
  }
  for (int j = i - 1; j >= 0; j--) cout << binaryNum[j];
}
long long int prime(long long int n) {
  long long int flag = 0;
  if (n == 1 || n == 2) {
    flag = 0;
  } else {
    if (n % 2 == 0)
      flag = 1;
    else {
      long long int i = 3;
      while (i <= sqrt(n) && flag == 0) {
        if (n % i == 0) flag = 1;
        i = i + 3;
      }
    }
  }
  return flag;
}
bool chk(long long int b[], long long int sz, long long int cnt) {
  long long int flag = 1;
  for (long long int i = 0; i < sz && flag == 1; i++) {
    if (b[i] < cnt) flag = 0;
  }
  return flag;
}
int main() {
  long long int n, i;
  cin >> n;
  long long int cnt = 1, flag = 1;
  map<long long int, long long int> mp;
  mp[n] = 1;
  while (flag == 1) {
    n = n + 1;
    while (n % 10 == 0) {
      n = n / 10;
    }
    if (mp[n] == 1) {
      flag = 0;
    } else {
      mp[n] = 1;
      cnt++;
    }
  }
  cout << cnt << "\n";
}
