直接模拟这个过程,次数不会超过 数的位数*10
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 3e5 + 7;
int n;
set<int> st;
void solve(int n) {
int t = n+1;
while(t%10 == 0) t /= 10;
if(st.count(t)) return;
st.insert(t);
solve(t);
}
int main() {
cin >> n;
st.insert(n);
solve(n);
cout << st.size() << endl;
return 0;
}