#include <bits/stdc++.h>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	int ans = 0;
	for(int z = 1; z <= b; z ++)
	{
		int it = z;
		int ws = 0;
		while(it != 0)
		{
			ws ++;
			it /= 10;
		}
		bool a[10];
		for(int i = 0; i <= 9; i ++)
		{
			a[i] = false;
		}
		int it2 = z;
		while(it2 != 0)
		{
			int shu = it2 % 10;
			a[shu] = true;
			it2 /= 10;
		}
		bool f = true;
		for(int i = 0; i <= 9; i ++)
		{
			if(i >= ws && a[i])
			{
				f = false;
			}
			else if(i < ws && !a[i])
			{
				f = false;
			}
		}
		if(f)
		{
			ans ++;
			cout << z << endl;
		}
	}
	cout << ans;
	return 0;
}