#include<bits/stdc++.h> using namespace std; bool f[7]; int main(){ int a,b,ans=0; cin>>a>>b; for(int i=a;i<=b;i++){ for(int j=0;j<=6;j++){ f[j]=0; } int y=0; int x=i; while(x){ y++; f[x%10]=1; x/=10; } bool z=true; for(int j=0;j<=y-1;j++){ if(f[j]==0)z=false; } if(z)ans++; } cout<<ans; return 0; }