#include<bits/stdc++.h>
using namespace std;
bool xy(int n)
{
	int s=0;
	while(n%10!=0)
	{
		s++;
		if(s==1&&n=='0') return true;
		else if(s==2&&n=='0'&&n=='1') return true;
		else if(s==3&&n=='0'&&n=='1'&&n=='2') return true;
		else if(s==4&&n=='0'&&n=='1'&&n=='2'&&n=='3') return true;
		else if(s==5&&n=='0'&&n=='1'&&n=='2'&&n=='3'&&n=='4') return true;
		else if(s==6&&n=='0'&&n=='1'&&n=='2'&&n=='3'&&n=='4'&&n=='5') return true;
		else return false;
		n=n/10;
	}
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	int a,b;
	cin>>a>>b;
	int cnt=0;
	for(int i=a;i<=b;i++)
	{
		if(xy(i)==true)
		{
			cnt++;
			
		}
	}
	cout<<a;
	return 0;
}