#include<bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ll long long
#define maxn 500005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    ll sum = 0;
    for(int i = 0 ; i <= n ; i++){
        int t = i;
        int s = 0;
        while(t){
            s += t % 10;
            t /= 10;
        }
        if(s <= b && s >= a){
            sum += i;
        }
    }
    cout << sum << '\n';
}