#include<iostream>
#include<algorithm>
using namespace std;
int n,a,b,c,ans=0;
int main()
{
	cin>>n>>a>>b;
	for (int i=1;i<=n;i++)
	{
		int x=i;
		int tmp=0;
		while (x)
		{
			tmp+=x % 10;
			x/=10;
		}
		if (tmp>=a && tmp<=b) ans+=i;
	}
	cout<<ans;
}