import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

	}

} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

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

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int max = sc.nextInt(); max 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 answer = 0; answer 0 for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		} int i = 1 ; int i = 1 ; i 1 i <= max i max i++ i++ i {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		} {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		} String num = String.valueOf(i); num String.valueOf(i) String.valueOf String i String[] numArray = num.split(""); numArray num.split("") num.split num "" int total = 0; total 0 for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			} int j = 0; int j = 0; j 0 j < numArray.length j numArray.length numArray numArray.length j++ j++ j {
				total += Integer.parseInt(numArray[j]);
			} {
				total += Integer.parseInt(numArray[j]);
			} total += Integer.parseInt(numArray[j]) total Integer.parseInt(numArray[j]) Integer.parseInt Integer numArray[j] numArray j if(total >= a && total <= b) {
				answer += i;
			} total >= a && total <= b total >= a total a total <= b total b {
				answer += i;
			} 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) {
		Scanner sc = new Scanner(System.in);

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

	}

} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int max = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 1 ; i <= max ; i++ ) {
			String num = String.valueOf(i);
			String[] numArray = num.split("");
			//int[] keta = new int[numArray.length];
			int total = 0;
			for (int j = 0; j < numArray.length; j++) {
				total += Integer.parseInt(numArray[j]);
			}
			if(total >= a && total <= b) {
				answer += i;
			}

		}
		System.out.println(answer);

	}

}
