import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} Main public static void main(String[] args) {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	} main {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	} int n n a a b; b try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		} {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) n = Integer.parseInt(sc.next()) n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc a = Integer.parseInt(sc.next()) a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc b = Integer.parseInt(sc.next()) b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int total = 0; total 0 for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		} {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		} int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10); sum i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10) (i%100)/10 (i%1000)/100 i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10) i/10000 i 10000 (i%10000)/1000 (i%10000) i 10000 1000 (i%1000)/100 (i%1000) i 1000 100 (i%100)/10 (i%100) i 100 10 (i%10) i 10 if (a <= sum && sum <= b) {
				total += i;
			} a <= sum && sum <= b a <= sum a sum sum <= b sum b {
				total += i;
			} total += i total i System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main{

	public static void main(String[] args) {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} public class Main{

	public static void main(String[] args) {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		int n, a, b;
		try (Scanner sc = new Scanner(System.in)) {
			n = Integer.parseInt(sc.next());
			a = Integer.parseInt(sc.next());
			b = Integer.parseInt(sc.next());
		}

		int total = 0;
		for (int i=1; i<=n; i++) {
			int sum = i/10000 + (i%10000)/1000 + (i%1000)/100 + (i%100)/10 + (i%10);
			if (a <= sum && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
}
