#include<stdio.h>
int main()
{
    int n,a,b,i,s=0,d,e,f,p,q;
    scanf("%d %d %d",&n,&a,&b);
    if(b<=36 && a<=b)
    {for(i=1;i<=n;i++)
    {

        if(i<1000)
           {d=i%100;
            q=d/10;
            e=i/100;
            p=i%10;
            f=e+p+q;
            if(f>=a && f<=b)
            {s=s+i;}}
    }
    printf("%d",s);}
}
