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

int Fn_total(int number){
    int total=0;
    while(number){
        total+=number%10;
        number/=10;
    }
    return total;
}

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int number=0 ,left=0, right=0;
    while(cin>>number>>left>>right){
        int answer=0;
        for(int cnt=1;cnt<=number;cnt++){
            if(Fn_total(cnt) >= left && Fn_total(cnt) <= right){
                answer+=cnt;
            }
        }
        cout<<answer<<"\n";
    }
    return 0;
}