import java.util.Scanner;

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 grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	}
} import java.util.Scanner; Scanner 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 grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	}
} 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 grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	} 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 grandSum = 0; grandSum 0 for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		} {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		} String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i int sum = 0; sum 0 for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			} char c s.toCharArray() s.toCharArray s {
				sum += (int) (c - '0');
			} {
				sum += (int) (c - '0');
			} sum += (int) (c - '0') sum (int) (c - '0') c '0' if (sum >= A && sum <= B) {
				grandSum += i;
			} sum >= A && sum <= B sum >= A sum A sum <= B sum B {
				grandSum += i;
			} grandSum += i grandSum i System.out.println(grandSum) System.out.println System.out System System.out grandSum String[] args args 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 grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	}
} 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 grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	}
} Main
import java.util.Scanner;

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 grandSum = 0;
		for (int i = 1; i <= N; i++) {
			String s = Integer.toString(i);
			int sum = 0;
			for (char c : s.toCharArray()) {
				sum += (int) (c - '0');
			}
			if (sum >= A && sum <= B) {
				grandSum += i;
			}
		}
		System.out.println(grandSum);
	}
}
