#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-7;
map<int, int> vis;
int main() {
  int n = read();
  int cnt = 1;
  vis[n] = 1;
  for (int i = n + 1;; ++i) {
    while (i % 10 == 0) i /= 10;
    if (vis[i])
      break;
    else
      vis[i] = 1;
    cnt++;
  }
  cout << cnt << endl;
}
