#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;

int a, b, ans;

int check(int x){
	vector<int> d, p;
	while (x){
		d.push_back(x % 10);
		x /= 10;
	}
	sort(d.begin(), d.end());
	p.resize(d.size());
	iota(p.begin(), p.end(), 0);
	return (d == p)?1:0;
}

int main(){
	scanf("%d %d", &a, &b);
	for (int i = a; i <= b; i++) ans += check(i);
	printf("%d\n", ans);
	return 0;
}