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 sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	}

} 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 sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	}

} 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 sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	} 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 sum = 0; sum 0 for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		} {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		} String x = Integer.toString(i); x Integer.toString(i) Integer.toString Integer i char[] data = x.toCharArray(); data x.toCharArray() x.toCharArray x int y = 0; y 0 for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			} int k = 0; int k = 0; k 0 k < data.length k data.length data data.length k++ k++ k {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			} {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			} y += Character.getNumericValue(data[k]) y Character.getNumericValue(data[k]) Character.getNumericValue Character data[k] data k if ((y >= A) && (y <= B)) {
				sum += i;
			} (y >= A) && (y <= B) (y >= A) y A (y <= B) y B {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc 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 sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	}

} 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 sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	}

} 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 sum = 0;

		for (int i = 0; i <= N; i++) {
			String x = Integer.toString(i);
			char[] data = x.toCharArray();
			int y = 0;
			for (int k = 0; k < data.length; k++) {
//				System.out.println(data[k]); //デバッグ
				y += Character.getNumericValue(data[k]);
			}
//			System.out.println(y); //デバッグ
			if ((y >= A) && (y <= B)) {
				sum += i;
			}
		}
		System.out.println(sum);

		sc.close();
	}

}
