# include <bits/stdc++.h>
using namespace std;
int a, b, cnt;
bool judge(string s){
	if (s[0] != '0') return false;
	for (int i = 1; i < s.size(); i++){
		if ((s[i] - '0') != (s[i - 1] - '0') + 1){
			return false;
		}
	}
	return true;
}
int main(){
	scanf("%d %d", &a, &b);
	for (int i = a; i <= b; i++){
		string s = to_string(i);
		sort(s.begin(), s.end());
		if (judge(s)){
			cnt++;
		}
	}
	printf("%d", cnt);
	return 0;
}