#include<bits/stdc++.h> #define int long long using namespace std; bool f[20]; int a,b,res; int get(int x){ int res=0; while(x){ res++; x/=10; } return res; } bool check(int x){ memset(f,0,sizeof(f)); int k=get(x); while(x){ int tmp=x%10; f[tmp]=1; x/=10; } for(int i=0;i<k;i++) if(!f[i]) return false; for(int i=k;i<=9;i++) if(f[i]) return false; return true; } signed main(){ ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); cin>>a>>b; for(int i=a;i<=b;i++) if(check(i)) res++; cout<<res<<"\n"; return 0; }