#include<iostream>
using namespace std;

int sums(int n){
    int re=0;
    while(n>9){
        re+=n%10;
        n/=10;
    }
    re+=n;
    return re;
}

int main(){
    int n,a,b;
    cin>>n>>a>>b;
    int sum=0;
    for(int i=1;i<=n;i++){
        if(sums(i)>=a && sums(i)<=b){
            sum+=i;
        }
    }
    cout<<sum;
    return 0;
}