#include <stdio.h>

int sum(int n) {
	int ans = 0;
	while (n) {
		ans += n % 10;
		n /= 10;
	}
	return ans;
}

int main() {
	int n, a, b, tmp, ans = 0;
	scanf("%d%d%d", &n, &a, &b);
	for (int i = 1; i <= n; i++){
		tmp = sum(i);
		if (a <= tmp && tmp <= b) ans += i;
	}
	printf("%d\n", ans);
}
