#include <bits/stdc++.h> using namespace std; int a,b,ans=0; bool f[15]; int main(){ cin>>a>>b; // a=1; // b=1000000; for(int i=a;i<=b;i++){ memset(f,false,sizeof f); int y=i,t=0;bool x=1; while(y){ t++; f[y%10]=1; y/=10; } for(int j=0;j<t;j++){ if(f[j]==0){ x=0; break; } } ans+=x; } cout<<ans<<endl; return 0; }