#include<iostream>
using namespace std;


int main(){
	int n,x,a,b,sum,count=0;
	
	cin>>n>>a>>b;
	for(int i=1;i<n+1;i++){
		sum=0;
		x=i;
		while(x!=0){
			sum+=x%10;
			x/=10;
		}
		if(a<=sum&&sum<=b)
			count+=i;
	}
	cout<<count<<endl;
}