import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int total = 0; total 0 for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		} {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		} int one = i % 10; one i % 10 i 10 int ten = Math.floorDiv(i % 100, 10); ten Math.floorDiv(i % 100, 10) Math.floorDiv Math i % 100 i 100 10 int hundred = Math.floorDiv(i % 1000, 100); hundred Math.floorDiv(i % 1000, 100) Math.floorDiv Math i % 1000 i 1000 100 int thousand = Math.floorDiv(i % 10000, 1000); thousand Math.floorDiv(i % 10000, 1000) Math.floorDiv Math i % 10000 i 10000 1000 int man = (i == 10000)? 1 : 0; man (i == 10000)? 1 : 0 (i == 10000) i 10000 1 0 int sum = one + ten + hundred + thousand + man; sum one + ten + hundred + thousand + man thousand hundred one + ten + hundred + thousand + man one ten hundred thousand man if (a <= sum && sum <= b) {
				total += i;
			} a <= sum && sum <= b a <= sum a sum sum <= b sum b {
				total += i;
			} total += i total i System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int total = 0;
		for (int i = 1; i <= n; i++) {
			int one = i % 10;
			int ten = Math.floorDiv(i % 100, 10);
			int hundred = Math.floorDiv(i % 1000, 100);
			int thousand = Math.floorDiv(i % 10000, 1000);
			int man = (i == 10000)? 1 : 0;

			int sum = one + ten + hundred + thousand + man;
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
}