#include<bits/stdc++.h>
#define R(X) cin>>X

using namespace std;
inline int digitSum(int num){
	int out=0;
	while(num!=0){
		out+=num%10;
		num/=10;
	}
	return out;
}
int main(){
	int N;R(N);
	int a,b;R(a);R(b);
	int sum=0;
	for(int i=1;i<=N;i++)
	    if(digitSum(i)<=b&&digitSum(i)>=a)
		    sum+=i;
	cout<<sum;
	return 0;
}