#include<iostream>
using namespace std;

int main(){
	int N,A,B,judge,sum=0;
	cin>>N>>A>>B;
  	for(int i=1;i<=N;++i){
		judge=i/10000+i/1000%10+i/100%10+i/10%10+i%10;
      	if(A<=judge&&judge<=B)sum+=i;
      }
  	cout<<sum<<endl;
  	return 0;
}