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 answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	}

	private static int getKetaGokei(int i) {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	}
} 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 answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	}

	private static int getKetaGokei(int i) {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	}
} 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 answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	} 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 answer = 0; answer 0 for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		} int i =1; int i =1; i 1 i <=n i n i++ i++ i {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		} {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		} int ketaGokei = getKetaGokei(i); ketaGokei getKetaGokei(i) getKetaGokei i if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			} a <=ketaGokei &&ketaGokei <=b a <=ketaGokei a ketaGokei ketaGokei <=b ketaGokei b {
				answer += i;
			} answer += i answer i System.out.println(answer) System.out.println System.out System System.out answer String[] args args private static int getKetaGokei(int i) {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	} getKetaGokei {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	} String[] numberArray = String.valueOf(i).split(""); numberArray String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" int ketaGokei = 0; ketaGokei 0 for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		} String number numberArray {
			ketaGokei += Integer.parseInt(number);
		} {
			ketaGokei += Integer.parseInt(number);
		} ketaGokei += Integer.parseInt(number) ketaGokei Integer.parseInt(number) Integer.parseInt Integer number return ketaGokei; ketaGokei int i i 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 answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	}

	private static int getKetaGokei(int i) {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	}
} 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 answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	}

	private static int getKetaGokei(int i) {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	}
} 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 answer = 0;
		for(int i =1;i <=n;i++) {
			int ketaGokei = getKetaGokei(i);
			if(a <=ketaGokei &&ketaGokei <=b ) {
				answer += i;
			}
		}
		System.out.println(answer);
	}

	private static int getKetaGokei(int i) {
		String[] numberArray = String.valueOf(i).split("");
		int ketaGokei = 0;
		for(String number : numberArray) {
			ketaGokei += Integer.parseInt(number);
		}
		return ketaGokei;
	}
}