#include<iostream>
using namespace std;

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