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