#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,A,B,S=0;cin>>N>>A>>B;
  for(int i=1;i<=N;i++){
    int s=0,a=i;
    while(a>0){s+=a%10;a/=10;}
    if(A<=s&&s<=B)S+=i;
  }
  cout<<S<<endl;
}