#include<bits/stdc++.h> #define int long long using namespace std; int a , b , ans; bool isluck(int n){ int m = n , k = n , idx = 0; while(m){ idx ++; m /= 10; } map<int , bool>mp; while(k){ if(k % 10 > idx - 1 or mp[k % 10]){ return 0; } mp[k % 10] = 1; k /= 10; } return 1; } signed main(){ ios::sync_with_stdio(false); cin.tie(0) , cout.tie(0); cin >> a >> b; for(int i = a ; i <= b ; i ++){ if(isluck(i)){ ans ++; } } cout << ans; return 0; }