#include<bits/stdc++.h>
using namespace std;
bool xys(int x){
	int w=0;
	int l=x;
	int s=0;
	while(l){
		l/=10;
		w++;
	}
	for(int i=0;i<w;i++){
		int t=x;
		while(t){
			if(t%10==i){
				s++;
				break;
			}
			t/=10;
		}
	}
	if(s==w) return 1;
	return 0;
}
int main(){
	int b,a,s=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(xys(i)==1){
			s++;
		}
	}
	cout<<s;
	return 0;
}