import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    }
  	//nの各桁の和
  	public static int calcSum(int n){
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    }
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    }
  	//nの各桁の和
  	public static int calcSum(int n){
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    }
} Main public static void main(String[] args){
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    } main {
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    } Scanner sc  = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int total = 0; total 0 for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        } {
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        } int sum = calcSum(i); sum calcSum(i) calcSum i if(sum >= a && sum <= b) total += i; sum >= a && sum <= b sum >= a sum a sum <= b sum b total += i total i System.out.println(total) System.out.println System.out System System.out total String[] args args //nの各桁の和
  	public static int calcSum(int n){
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    } calcSum {
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    } int sum = 0; sum 0 while(n > 0){
        	sum += n % 10;
          	n /= 10;
        } n > 0 n 0 {
        	sum += n % 10;
          	n /= 10;
        } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public class Main{
	public static void main(String[] args){
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    }
  	//nの各桁の和
  	public static int calcSum(int n){
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    }
} public class Main{
	public static void main(String[] args){
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    }
  	//nの各桁の和
  	public static int calcSum(int n){
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    }
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc  = new Scanner(System.in);
      	int n = sc.nextInt();
      	int a = sc.nextInt();
      	int b = sc.nextInt();
      	int total = 0;
      	for(int i = 1; i <= n; i++){
        	int sum = calcSum(i);
          	if(sum >= a && sum <= b) total += i;
        }
      	System.out.println(total);
    }
  	//nの各桁の和
  	public static int calcSum(int n){
      	int sum = 0;
      	while(n > 0){
        	sum += n % 10;
          	n /= 10;
        }
      	return sum;
    }
}