#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long N; if (!(cin >> N)) return 0; string s = to_string(N); int L = (int)s.size(); set st; for (int pos = 0; pos <= L; ++pos) { for (int d = 0; d <= 9; ++d) { if (pos == 0 && d == 0) continue; // không cho s? m?i b?t ??u b?ng 0 string t = s.substr(0, pos) + char('0' + d) + s.substr(pos); st.insert(t); } } cout << st.size() << '\n'; return 0; }