#include <bits/stdc++.h>
using namespace std;


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int n,a,b,ans=0;
	cin>>n>>a>>b;
	for(int i = a; i <= n; i++)
	{
		int tem = i , k = 0;
		while( tem / 10 )
		{
			k+=tem%10;
			tem/=10;
			if(k > b)
				break;
		}
		k += tem;
		if( k>=a && k<=b)
		{
			
			ans+=i;
		}
	}
	cout<<ans<<"\n";
}