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 c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	} 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 c[] = { 1, 10, 100, 1000, 10000 }; c { 1, 10, 100, 1000, 10000 } 1 10 100 1000 10000 int total = 0; total 0 int k; k for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		} {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		} int sum = 0; sum 0 k = i k i for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			} int j = 0; int j = 0; j 0 j < 5 j 5 j++ j++ j {
				sum += k % 10;
				k = k / 10;
			} {
				sum += k % 10;
				k = k / 10;
			} sum += k % 10 sum k % 10 k 10 k = k / 10 k k / 10 k 10 if (sum >= a && sum <= b) {
				total += i;
			} sum >= a && sum <= b sum >= a sum a 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) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
} 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 c[] = { 1, 10, 100, 1000, 10000 };
		int total = 0;
		int k;
		for (int i = 1; i <= n; i++) {
			int sum = 0;
			k = i;
			for (int j = 0; j < 5; j++) {
				sum += k % 10;
				k = k / 10;
			}
			if (sum >= a && sum <= b) {
				total += i;
			}
		}
		System.out.println(total);
	}
}
