import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer output = 0; output 0 Integer sum = 0; sum 0 Integer buf =0; buf 0 Integer nInteger = new Integer(scanner.next()); nInteger new Integer(scanner.next()) Integer aInteger = new Integer(scanner.next()); aInteger new Integer(scanner.next()) Integer bInteger = new Integer(scanner.next()); bInteger new Integer(scanner.next()) for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		} int i = 1; int i = 1; i 1 i <= nInteger i nInteger i++ i++ i {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		} {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		} buf = i buf i sum = 0 sum 0 while(buf != 0){
				sum += buf%10;
				buf /= 10;
			} buf != 0 buf 0 {
				sum += buf%10;
				buf /= 10;
			} sum += buf%10 sum buf%10 buf 10 buf /= 10 buf 10 if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			} sum >= aInteger && sum <= bInteger sum >= aInteger sum aInteger sum <= bInteger sum bInteger {
				output +=i ;
			} output +=i output i System.out.println(output) System.out.println System.out System System.out output scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	}
}
