#include<cstdio>
#include<cmath>
int digit(int);
int main(){
	int n,a,b;
	scanf("%d",&n);
	scanf("%d",&a);
	scanf("%d",&b);
	int sum = 0;
	for(int x = 1;x <= n;x++){
		int digitsum = digit(x);
		if (digitsum <= b&&digitsum >= a) sum += x;
	}
	printf("%d",sum);
} 

int digit(int x){
	int ans = 0;
	for(int a = log10(x);a >= 0;a--){
		ans += x/(int)(pow(10,a));
		x = x%(int)(pow(10,a));
	}
	return ans;
}