#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 11;
int a, b, ans;
string str = "", s = "";
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0); 
	cin >> a >> b;
	for(int i = a; i <= b; i++){
		str = "", s = "";
		int x = i, l = 0;
		while(x){
			int j = x % 10;
			l++;
			str += (j + '0');
			x /= 10;
		}
		for(int i = 0; i < l; i++){
			s += (i + '0');
		}
		if(str[0] == 0) continue;
		sort(str.begin(), str.end());
		if(str == s){
			ans++;
//			cout << s << '\n';
		}
	}
	cout << ans << '\n';
	return 0;
}