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

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	}
} 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 summation = 0;

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	}
} 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 summation = 0;

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	} main {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int summation = 0;

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	} 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 summation = 0; summation 0 for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		} {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		} int sum = 0; sum 0 String I = String.valueOf(i); I String.valueOf(i) String.valueOf String i for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			} int j = 0; int j = 0; j 0 j < I.length() j I.length() I.length I j++ j++ j {
				sum += Integer.parseInt(I.substring(j, j + 1));
			} {
				sum += Integer.parseInt(I.substring(j, j + 1));
			} sum += Integer.parseInt(I.substring(j, j + 1)) sum Integer.parseInt(I.substring(j, j + 1)) Integer.parseInt Integer I.substring(j, j + 1) I.substring I j j + 1 j 1 if (sum >= A && sum <= B) {
				summation += i;
			} sum >= A && sum <= B sum >= A sum A sum <= B sum B {
				summation += i;
			} summation += i summation i System.out.println(summation) System.out.println System.out System System.out summation 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 summation = 0;

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	}
} 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 summation = 0;

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	}
} 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 summation = 0;

		for (int i = 1; i <= N; i++) {
			int sum = 0;
			String I = String.valueOf(i);
			for (int j = 0; j < I.length(); j++) {
				sum += Integer.parseInt(I.substring(j, j + 1));
			}
			if (sum >= A && sum <= B) {
				summation += i;
			}
		}

		System.out.println(summation);
	}
}