#include<cstdio>
#define f(i,a,b) for(register int i=(a);i<=(b);i=-(~(i)))
int n,sum,a,b;
int split(int x)
{int y=0;while(x)y+=x%10,x/=10;return y;} 
int main()
{
	int x;
	scanf("%d%d%d",&n,&a,&b);
	f(i,1,n)if((x=split(i))>=a&&x<=b)sum+=i;
	printf("%d\n",sum);
} 