//luogu :xmy201315 welcome to chat with me #include <bits/stdc++.h> using namespace std; #define rep(i,l,r) for(int i=l;i<=r;i++) #define per(i,l,r) for(int i=l;i>=r;i--) int main(){ int a,b,ans=0; cin>>a>>b; rep(i,a,b){ int x=i,a[200],l=0,b[200],f=1; while(x)a[++l]=x%10,x/=10; memset(b,0,sizeof(b)); rep(i,1,l)b[a[i]]++; rep(i,0,l-1) if(!b[i]){ f=0; break; } if(f)ans++; } cout<<ans<<'\n'; } //^_^,AC