#include<bits/stdc++.h> using namespace std; bool fpc(int n){ int t=n,s=0,s1=0; while(t){ s++; t/=10; } vector<bool> a(s,true); while(n){ if(a[n%10]&&n%10<s){ a[n%10]=false; s1++; } n/=10; } if(s==s1){ return true; } else{ return false; } } int main(){ int a,b,s=0; cin>>a>>b; for(int i=a;i<=b;i++){ if(fpc(i)){ s++; } } cout<<s; return 0; }