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

int main()
{
     int n,a,b,x,i,sum,ans=0;
         cin>>n>>a>>b;
         for(i=1;i<=n;i++)
         {
             x=i;
             sum=0;
             while ( x> 0 ) {
                sum +=  x% 10;
                    x /= 10;
            }
            if(sum>=a && sum<=b)
                ans=ans+i;

         }
    cout<<ans<<endl;
return 0;
}
