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

int main(){
int n,a,b;
cin >> n >> a >> b;
int ans =0;
for(int i=1;i<=n;i++){
    int k =i;
    int che =0;
    while(k>0){
        che+=k%10;
        k/=10;
    }
    if(che>=a&&che<=b)ans+=i;
}
cout << ans << endl;
}