#include // #include using namespace std; #if __cplusplus >= 202002L using namespace numbers; #endif int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); string s; cin >> s; set res; for(auto c = '1'; c <= '9'; ++ c){ res.insert(stoll(c + s)); } for(auto i = 1; i <= (int)s.size(); ++ i){ for(auto c = '0'; c <= '9'; ++ c){ res.insert(stoll(s.substr(0, i) + c + s.substr(i))); } } cout << (int)res.size() << "\n"; return 0; } /* */