#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,num=0;
	string t;
	bool f=1;
	char x;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		f=1;
		t=to_string(i);
		for(int j=0;j<t.size();j++){
			for(int k=j;k<t.size();k++){
				if(t[k]<t[j]){
					x=t[k];
					t[k]=t[j];
					t[j]=x;
				}
			}
		}
		for(int j=0;j<t.size();j++){
//			cout<<t[j]-'0'<<"  "<<j<<endl;
			if(t[j]-'0'!=j)  f=0;
		}
		if(f==1)  num++;
//		cout<<f<<endl;
//		cout<<num<<endl;
	}
	cout<<num;
	return 0;
}