import static java.lang.System.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		B(sc);
	}
	
	public static void A(Scanner sc) {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	}
	
	
	//各桁の和を計算
	public static int calcsumo(int x) {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	}
	public static void B(Scanner sc) {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	}
} import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		B(sc);
	}
	
	public static void A(Scanner sc) {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	}
	
	
	//各桁の和を計算
	public static int calcsumo(int x) {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	}
	public static void B(Scanner sc) {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		B(sc);
	} main {
		Scanner sc = new Scanner(System.in);
		B(sc);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) B(sc) B sc String[] args args public static void A(Scanner sc) {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	} A {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	} int left =  0; left 0 int right = 0; right 0 for(int i=0;i<2;i++) {
			left += sc.nextInt();
		} int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
			left += sc.nextInt();
		} {
			left += sc.nextInt();
		} left += sc.nextInt() left sc.nextInt() sc.nextInt sc for(int i=0;i<2;i++) {
			right += sc.nextInt();
		} int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
			right += sc.nextInt();
		} {
			right += sc.nextInt();
		} right += sc.nextInt() right sc.nextInt() sc.nextInt sc if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right"); left==right left right out.println("Balanced") out.println out "Balanced" if(left>right) out.println("Left");
		else out.println("Right"); left>right left right out.println("Left") out.println out "Left" out.println("Right") out.println out "Right" Scanner sc sc //各桁の和を計算
	public static int calcsumo(int x) {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	} calcsumo {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	} String s = String.valueOf(x); s String.valueOf(x) String.valueOf String x int sum = 0; sum 0 for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			sum += Character.getNumericValue((s.charAt(i)));
		} {
			sum += Character.getNumericValue((s.charAt(i)));
		} sum += Character.getNumericValue((s.charAt(i))) sum Character.getNumericValue((s.charAt(i))) Character.getNumericValue Character (s.charAt(i)) s.charAt s i return sum; sum int x x public static void B(Scanner sc) {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	} B {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	} 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=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		} {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		} int temp = calcsumo(i); temp calcsumo(i) calcsumo i if(temp>=A && temp<=B) sum+=i; temp>=A && temp<=B temp>=A temp A temp<=B temp B sum+=i sum i out.println(sum) out.println out sum Scanner sc sc public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		B(sc);
	}
	
	public static void A(Scanner sc) {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	}
	
	
	//各桁の和を計算
	public static int calcsumo(int x) {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	}
	public static void B(Scanner sc) {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		B(sc);
	}
	
	public static void A(Scanner sc) {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	}
	
	
	//各桁の和を計算
	public static int calcsumo(int x) {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	}
	public static void B(Scanner sc) {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	}
} Main
import static java.lang.System.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		B(sc);
	}
	
	public static void A(Scanner sc) {
		int left =  0;
		int right = 0;
		for(int i=0;i<2;i++) {
			left += sc.nextInt();
		}
		for(int i=0;i<2;i++) {
			right += sc.nextInt();
		}
		if(left==right) out.println("Balanced");
		else if(left>right) out.println("Left");
		else out.println("Right");
	}
	
	
	//各桁の和を計算
	public static int calcsumo(int x) {
		String s = String.valueOf(x);
		int sum = 0;
		for(int i=0;i<s.length();i++) {
			sum += Character.getNumericValue((s.charAt(i)));
		}
		return sum;
	}
	public static void B(Scanner sc) {
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;
		for(int i=1;i<=N;i++) {
			int temp = calcsumo(i);
			if(temp>=A && temp<=B) sum+=i;
		}
		out.println(sum);
	}
}
