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 someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	}
	private static int calcSum(int num){
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 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 someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	}
	private static int calcSum(int num){
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 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 someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	} 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 someSums = 0; someSums 0 for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += 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) someSums += i;	
		} {
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		} int sum = calcSum(i); sum calcSum(i) calcSum i if(sum >= A && sum <= B) someSums += i; sum >= A && sum <= B sum >= A sum A sum <= B sum B someSums += i someSums i System.out.println(someSums) System.out.println System.out System System.out someSums String[] args args private static int calcSum(int num){
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 10;
		}
		return sum;
	} calcSum {
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 10;
		}
		return sum;
	} int sum = 0; sum 0 while(num > 0){
			sum += num % 10;
			num /= 10;
		} num > 0 num 0 {
			sum += num % 10;
			num /= 10;
		} sum += num % 10 sum num % 10 num 10 num /= 10 num 10 return sum; sum int num num 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 someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	}
	private static int calcSum(int num){
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 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 someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	}
	private static int calcSum(int num){
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 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 someSums = 0;
		for(int i = 1; i <= N; i++){
			int sum = calcSum(i);
			if(sum >= A && sum <= B) someSums += i;	
		}
		System.out.println(someSums);	
	}
	private static int calcSum(int num){
		int sum = 0;
		while(num > 0){
			sum += num % 10;
			num /= 10;
		}
		return sum;
	}
}