#include <bits/stdc++.h>
using namespace std;
unsigned long long int ans = 0;
void f(unsigned long long int x) {
  bool pre = 1;
  while (x >= 10) {
    if (pre == 1) x++;
    ans += (10 - x % 10);
    if (x % 10 == 0) {
      ans -= 10;
      pre = 0;
    } else
      pre = 1;
    x /= 10;
  }
  ans += 10;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  unsigned long long int x;
  cin >> x;
  if (x < 10) {
    cout << 9 << endl;
    return 0;
  }
  f(x);
  cout << ans << endl;
  return 0;
}
