#include <iostream>
using namespace std;
 //Compiler version g++ 6.3.0

 int main()
 {
 	int n,a,b,r=0;
 	cin >> n>>a>>b;
 	for (int i = 0; i <= n; i++){
 		int c=0,t=i;
		 for(int j=0;j<5;j++)c+=t%10,t/=10;
		 if(a<=c&&c<=b)r+=i;
 	}
 	cout << r << endl;
 }