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