#include <iostream>
using namespace std;
int calculateEnergy(int x) {
int energy = 0;
while (x > 0) {
energy += x % 10;
x /= 10;
}
return energy;
}
int main() {
int N, L, R;
cin >> N >> L >> R;
int total = 0;
for (int i = 1; i <= N; ++i) {
int energy = calculateEnergy(i);
if (energy >= L && energy <= R) {
total += i;
}
}
cout << total << endl;
return 0;
}