// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int R , ans=0 ;



int dec(int n){

	int temp=0;

	while(n){

		temp+=n%10;

		n/=10;

	}

	return temp;	

}



int main()

{

	int N , a , b ;

	

	cin>>N>>a>>b;

	

	int m=min(a,b) , M=max(a,b) ;

	

	for( int i ; i<=N ; i++ ){

		int te = dec(i);

		if( te>=m && te<=M )

			ans+=i;

	}

	

	cout<<ans<<endl;

	return 0;			

}

// Faster C++ solution for the same problem (measured speedup: 5.239465830583695x):
#include<stdio.h>

#include<string.h>



#define FOR(i,a,b) for(int i=a;i<b;i++)

#define FORN(i,a,b) for(int i=a;i<=b;i++)

#define INT_MAX 2147483647

#define INT_MIN -2147483648



typedef long long ll;			//%ld.

typedef long long int lli;		//%lld.

typedef unsigned long long ull;	//%llu.

// int %d, double %lf ,float %f ,string %s.



void swap(int *x,int *y);

int max(int x,int y);

int min(int x,int y);

void sortSeq(int dt[],int l,int r);

void sortIns(int dt[],int l,int r);

void mergeSort(int dt[],int l,int r);

int binser(int nilai,int dt[],int l,int r);

int abs(int x);

double maxD(double x,double y);

double minD(double x,double y);



//main code

int hitung(int x){

	int m = 0;

	while(x>0){

		m+=(x%10);

		x/=10;

	}

	return m;

}



int main(){

	int n , a, b;

	scanf("%d %d %d",&n,&a,&b);

	int hasil = 0;

	for(int i=1;i<=n;i++){

		int m = hitung(i);

		if(m>=a&&m<=b){

			hasil+=i;

		}

	}

	printf("%d\n",hasil);

}



































///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

double maxD(double x,double y){

	return x > y ? x : y;

}

double minD(double x,double y){

	return x < y ? x : y;

}

int abs(int x){

	if(x<0)	return -x;

	return x;

}

void merge(int arr[], int aLeft , int aRight , int bLeft , int bRight){ //merge

	int size = bRight - aLeft + 1;

	int temp[size];                

	int tIndex = 0;

	int aIndex = aLeft;

	int bIndex = bLeft;

	while( (aIndex <= aRight)&&(bIndex <= bRight))

	{

		if(arr[aIndex]<=arr[bIndex])

		{

			temp[tIndex] = arr[aIndex];

			aIndex = aIndex +1;

		}

		else

		{

			temp[tIndex] = arr[bIndex];

			bIndex = bIndex + 1;

		}

		tIndex = tIndex + 1;

	}

	while(aIndex <= aRight)

	{

		temp[tIndex] = arr[aIndex];

		aIndex = aIndex + 1;

		tIndex = tIndex + 1;

	}

	while(bIndex <= bRight)

	{

		temp[tIndex] = arr[bIndex];

		bIndex = bIndex + 1;

		tIndex = tIndex + 1;

	}

	for(int i = 0 ; i<= size-1 ; i++)

	{

		arr[aLeft + i] = temp[i];

	}

}



void swap(int *a,int *b){ //swap

	int temp = *a;

	*a = *b;

	*b = temp;

}

int max(int a,int b){ //maksimum

	return a>b ? a : b;

}

int min(int a,int b){ //minimum

	return a<b ? a : b;

}

void sortSeq(int arr[],int l,int r){ //sequencial sort

	for(int i=l;i<=r-1;i++)

		for(int j=i+1;j<=r;j++)

			if(arr[j]<arr[i])

				swap(&arr[i],&arr[j]);

}

void sortIns(int h[],int l,int r){ //insertion sort

	for(int i=l;i<=r;i++){

		int pos=i;

		while((pos>1)&&(h[pos]<h[pos-1])){

			swap(&h[pos],&h[pos-1]);

			pos=pos-1;

		}

	}

}

void mergeSort(int arr[],int left,int right){ //merge sort

	if( left == right )

		return; 

	else{

		int mid = (left+right)/2;    	 

		mergeSort(arr,left,mid);	

		mergeSort(arr,mid+1,right);

		merge(arr,left,mid,mid+1,right); 

	}

}

int binser(int x,int dt[],int kiri,int kanan){ //tidak ada = -1

	int hasil = -1;

	while((kiri<=kanan)&&(hasil==0)){

		int tengah=(kiri+kanan)/2;

		if(x<dt[tengah])

			kanan=tengah-1;

		else if(x>dt[tengah])

			kiri=tengah+1;

		else

			hasil=tengah;

	}

	return hasil;

}