#include<bits/stdc++.h>
#define X first
#define Y second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define mm(x,n) memset(x,n,sizeof(x))
#define IOS cin.tie(0); ios::sync_with_stdio(0);
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int maxn = 2e5+5;

int main(){IOS
	int n,a,b;	
	cin >> n >> a >> b;
	ll ans = 0;
	rep(i,1,n){
		int sum = 0;
		int j = i;
		while(j){
			sum += j%10;
			j /= 10;
		}
		if(sum>=a && sum<=b)
			ans += i;
	} 
	cout<<ans<<'\n';
}
