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