#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);
#define int long long
#define X first
#define Y second
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define All(x) x.begin() , x.end()
#define de(x,y) cout<<#x<<" "<<x<<y;
#define pray(a,i,n_thing) for(int x=i;x<=(i+n_thing);x++) cout<<#a<<"["<<x<<"] :"<<a[x]<<endl;
#define mem(aa,x) memset(aa,x,sizeof aa)
#define pb push_back
typedef long long ll;
typedef pair<int,int> ii;
const int maxn=4e5+5;
int arr[maxn];

int f(int x){
	if(x<10) return x;
	return f(x/10)+x%10;
}

main(){
    int N,A,B,sum=0;
    cin>>N>>A>>B;
    rep(i,1,N){
    	if(A<=f(i)&&f(i)<=B)
		    sum+=i;
	}
	cout<<sum<<"\n";
}

