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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		} {
			int sum = 0;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		} int sum = 0; sum 0 String target = String.valueOf(i); target String.valueOf(i) String.valueOf String i String[] targetSplit = target.split(""); targetSplit target.split("") target.split target "" for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			} int j = 0; int j = 0; j 0 j < targetSplit.length j targetSplit.length targetSplit targetSplit.length j++ j++ j {
				sum += Integer.parseInt(targetSplit[j]);
			} {
				sum += Integer.parseInt(targetSplit[j]);
			} sum += Integer.parseInt(targetSplit[j]) sum Integer.parseInt(targetSplit[j]) Integer.parseInt Integer targetSplit[j] targetSplit j 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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			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;
			String target = String.valueOf(i);
			String[] targetSplit = target.split("");
			for (int j = 0; j < targetSplit.length; j++) {
				sum += Integer.parseInt(targetSplit[j]);
			}
			if (A <= sum && sum <= B) {
				res += i;
			}
		}
		System.out.print(res);
	}
}
