# include <iostream>
using namespace std;
int main()
{
	int a,b,n,ans=0;
	cin>>n>>a>>b;
	for(int i=1;i<=n;i++)
	{	
		int j=i;
		int l=0;
		while(j>0)
		{
			l+=j%10;
			j/=10;
		}
		if(l>=a&&l<=b)
		ans+=i;
	}
	cout<<ans;
	return 0;
}