#include<bits/stdc++.h> using namespace std; long long q,w,n,cnt=0; //1023 bool pd(long long n){ int len=0; int a[1000]={0}; while(n){ len++; a[n%10]++; n=n/10; }//4 for(int i=0;i<=9;i++){ if(a[i]>1) { return false; } if(i<=len-1){ if(a[i]==0) { return false; } } if(i>len-1){ if(a[i]>0) { return false; } } } return true; } int main(){ cin>>q>>w; for(n=q;n<=w;n++){ if(pd(n)==true){ cnt++; } } cout<<cnt; return 0; }