#include <iostream>
using namespace std;

int main()
{
	int n, sum = 0, a, b, c = 0;
	cin >> n >> a >> b;
	for (int x=1;x<=n;x++)
	{ 
	 sum = 0;
	 for (int i = x; i > 0;)
	 {
		sum += i % 10;
		i = i / 10;
	 }
	 if (sum >= a && sum <= b)
		 c += x;
	}
	cout << c;
}
