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