import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

} Main public static void main(String[] args) {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	} main {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	} try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String strArr[] = br.readLine().split(" "); strArr br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(strArr[0]); n Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 int a = Integer.parseInt(strArr[1]); a Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 int b = Integer.parseInt(strArr[2]); b Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 int answer = 0; answer 0 for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			} int i = 1; int i = 1; i 1 i < n + 1 i n + 1 n 1 i++ i++ i {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			} {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			} int num = i; num i int sum = 0; sum 0 while (num != 0) {
					sum += num % 10;
					num /= 10;
				} num != 0 num 0 {
					sum += num % 10;
					num /= 10;
				} sum += num % 10 sum num % 10 num 10 num /= 10 num 10 if (sum >= a && sum <= b ) {
					answer = answer + i;
				} sum >= a && sum <= b sum >= a sum a sum <= b sum b {
					answer = answer + i;
				} answer = answer + i answer answer + i answer i System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

} public class Main {

	public static void main(String[] args) {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		try {
			InputStreamReader isr = new InputStreamReader(System.in);
			BufferedReader br = new BufferedReader(isr);
			String strArr[] = br.readLine().split(" ");

			int n = Integer.parseInt(strArr[0]);
			int a = Integer.parseInt(strArr[1]);
			int b = Integer.parseInt(strArr[2]);
			int answer = 0;

			for (int i = 1; i < n + 1; i++) {
				int num = i;
				int sum = 0;

				while (num != 0) {
					sum += num % 10;
					num /= 10;
				}

				if (sum >= a && sum <= b ) {
					answer = answer + i;
				}
			}
			System.out.println(answer);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
