import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int i = 0; i 0 int sum = 0; sum 0 for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		} i = 1; i = 1 i 1 i <= n i n i++ i++ i {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		} {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		} int i1 = i/10000; i1 i/10000 i 10000 int i2 = (i - (i1 * 10000)) / 1000; i2 (i - (i1 * 10000)) / 1000 (i - (i1 * 10000)) i (i1 * 10000) i1 10000 1000 int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100; i3 (i - (i1 * 10000) - (i2 * 1000)) / 100 (i - (i1 * 10000) - (i2 * 1000)) i - (i1 * 10000) - (i2 * 1000) i (i1 * 10000) i1 10000 (i2 * 1000) i2 1000 100 int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10; i4 (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10 (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) (i2 * 1000) i - (i1 * 10000) - (i2 * 1000) - (i3 * 100) i (i1 * 10000) i1 10000 (i2 * 1000) i2 1000 (i3 * 100) i3 100 10 int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10; i5 (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10 (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) (i2 * 1000) i - (i1 * 10000) - (i2 * 1000) - (i3 * 100) i (i1 * 10000) i1 10000 (i2 * 1000) i2 1000 (i3 * 100) i3 100 10 int sum2 = i1 + i2 + i3 + i4 + i5; sum2 i1 + i2 + i3 + i4 + i5 i4 i3 i1 + i2 + i3 + i4 + i5 i1 i2 i3 i4 i5 if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			} a <= sum2 && sum2 <= b a <= sum2 a sum2 sum2 <= b sum2 b {
				sum = sum + i;
			} sum = sum + i sum sum + i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		int i = 0;
		int sum = 0;
		for(i = 1; i <= n; i++) {
			int i1 = i/10000;
			int i2 = (i - (i1 * 10000)) / 1000;
			int i3 = (i - (i1 * 10000) - (i2 * 1000)) / 100;
			int i4 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) / 10;
			int i5 = (i - (i1 * 10000) - (i2 * 1000) - (i3 * 100)) % 10;
			int sum2 = i1 + i2 + i3 + i4 + i5;
			if(a <= sum2 && sum2 <= b) {
				sum = sum + i;
			}
		}
		System.out.println(sum);
	}
}