#include<iostream>

using namespace std;

int main(){
	int N,A,B;
        int ans=0;
	cin>>N>>A>>B;
	for(int i=1;i<=N;i++){
		int c=0,n=i;
		for(int j=0;j<5;j++){
			c=c+n%10;
			n=n/10;
		}
		if(A<=c&&c<=B)ans=ans+i;
	}
	cout<<ans;
        return 0;
}