#include<iostream>
using namespace std;
bool z(int n,int j,int k){
int s=0;
while(n!=0){
s+=n%10;
n/=10;}
if(s>=j&&s<=k) return 1;
return 0;}
int main(){
int n,a,b,s=0;
cin>>n>>a>>b;
for(int i=1;i<=n;i++)
if(z(i,a,b)) s+=i;
cout<<s<<endl;}