#include<bits/stdc++.h> using namespace std; bool check(int x) { int fu=x,count=0; while(fu!=0) { count+=1; fu/=10; } // cout << "count" << count << endl; bool found[count]; memset(found,false,count); while(x!=0) { int wei=x%10; if(found[wei]==true||wei>=count) return false; else if(found[wei]==false) found[wei]=true; x/=10; } for(int i=0;i<count;i++) { // cout << count << endl; if(found[i]==false) return false; } return true; } int main() { int n,m; cin >> n >> m; int ans=0; for(int i=n;i<=m;i++) { if(check(i)==true) { // cout << i << " "; ans+=1; } } cout << ans << endl; return 0; }