#include <bits/stdc++.h>
using namespace std;
int a,b,ans = 0;
int g[100];
bool lucky(int n){
	int wei = 0;
	while(n){
		g[++wei] = n % 10;
		n /= 10;
	}
	sort(g + 1,g + wei + 1);
	for(int i = 1;i <= wei;i++){
		if(g[i] != i - 1) return 0;
	}
	return 1;
}
int main(){
	cin >> a >> b;
	for(int i = a;i <= b;i++){
		if(lucky(i)) ans++;
	}
	cout << ans;
	return 0;
}