#include <bits/stdc++.h> using namespace std; bool check(int n) { int t = n; int cnt = 0; while(t) { cnt++; t /= 10; } //cout << cnt << endl; bool f[1000] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; t = n; while(t) { f[t % 10] = 1; t /= 10; } for(int i = 0; i < cnt; i++) if(!f[i]) return 0; return 1; } int cnt; int main() { int a, b; cin >> a >> b; //cout << check(a) << ' ' << check(b); for(int i = a; i <= b; i++) { if(check(i)) cnt++; } cout << cnt << endl; return 0; }