#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,s=0,ss,c,i,d;
    cin>>n>>a>>b;

    for( i=a;i<=n;i++)
    {
        c=i;
        ss=0;
        while(c>0)
        {
            d=c%10;
            ss=d+ss;
            c=c/10;
        }
        if(ss>=a&&ss<=b)
            s=s+i;
    }
    cout<<s<<endl;

}
