#include<bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define eb emplace_back
#define int long long
#define MOD 1000000007
#define PI 2*acos(0)
using namespace std;
int32_t main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int n, a, b, ans = 0; cin >> n >> a >> b;
	for (int i = 1; i <= n; i++) {
		int ii = i, sum = 0;
		do {
			sum += ii % 10;
		} while (ii /= 10);
		if (a <= sum && sum <= b)
			ans += i;
	}
	
	cout << ans << '\n';
	return 0;			
}

	
