#include<bits/stdc++.h> using namespace std; int a, b, s; bool f; signed main() { cin >> a >> b; for (int i = a; i <= b; i++) { string x = to_string(i); f = 0; sort(x.begin(), x.end()); for (int j = 0; j < x.size(); j++) { if (int(x[j]) - 48 != j) { f = 1; break; } } if (!f) { s++; } } cout << s << "\n"; return 0; }