// 第一题 (p1.cpp, 75分):幸运数字 
#include <bits/stdc++.h>
using namespace std;
int n, m, ans;
bool check(int x)
{
	int len = 0; // x的长度 
	int cnt[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // 枚举每个数位出现的次数 
	while(x) 
	{
		cnt[x % 10]++;
		x /= 10;
		len++; 
	}
	for(int i = 0; i < len; i++) // 枚举1~len-1的数位 
	{
		if(cnt[i] != 1) return false; // 如果有一个数位出现的次数不为1,那么直接结束循环 
	}
	return true;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	for(int i = n; i <= m; i++) if(check(i)) ans++;
	cout << ans << '\n';
	return 0;
}