#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int n,a,b,ans=0,t,sum;
	cin>>n>>a>>b;
	for(int i=a; i<=n ; i++)
	{
		t=i;
		sum=0;
		while(t)	{sum+=t%10;t/=10;} 
		if(sum>=a && sum<=b)	ans+=i;
	}
	cout<<ans<<endl;
}
