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