#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

int f(int n) {
    int rs = 0;
    while(n) {
        rs += (n % 10);
        n /= 10;
    }
    return rs;
}

int main() {

    int n, a, b;
    cin >> n >> a >> b;

    LL calc = 0;
    for(int i = 1; i <= n; i++) {
        int rs = f(i);
        if(rs <= b and rs >= a) calc+= i;
    }

    cout << calc << endl;

    return 0;
}
