#include<bits/stdc++.h>
using namespace std;
int cd(int n){
	int temp=0;
	while(n>0){
		n/=10;
		temp++;
	}
	return temp;
}
bool xy(int n,int m){
	while(n>0){
		if(n%10==m){
			return true;
		}
		n/=10;
	}
	return false;
}
int main(){
	int a,b,coun=0;
	cin >> a >> b;
	for(int i=a;i<=b;i++){
		int len=cd(i);
		bool g=1;
		for(int j=0;j<len;j++){
			if(xy(i,j)==false){
				g=0;
				break;
			}
		}
		if(g==1){
			coun++;
		}
	}
	cout << coun << endl;
	return 0;
}