import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	} 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 res = 0; res 0 for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		} {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		} int sum = 0; sum 0 int value = i; value i while (value > 0) {
				sum += value % 10;
				value /= 10;
			} value > 0 value 0 {
				sum += value % 10;
				value /= 10;
			} sum += value % 10 sum value % 10 value 10 value /= 10 value 10 if (A <= sum && sum <= B) {
				res += i;
			} A <= sum && sum <= B A <= sum A sum sum <= B sum B {
				res += i;
			} res += i res i System.out.print(res) System.out.print System.out System System.out res String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int res = 0;
		for (int i = 1; i <= N; i++) {
			int sum = 0;
			int value = i;
			while (value > 0) {
				sum += value % 10;
				value /= 10;
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	}
}
