#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second

int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        int cnt=0;
        int tmp=i;
        while(tmp>0)
        {
            cnt+=(tmp%10);
            tmp/=10;
        }
        if(cnt<=b&&a<=cnt)
            ans+=i;
    }
    cout<<ans<<'\n';
}
