import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt() n sc.nextInt() sc.nextInt sc a = sc.nextInt() a sc.nextInt() sc.nextInt sc b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int sum = 0; sum 0 for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		} {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		} int num = 0 num 0 c = i; c i for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			} int j = 0; int j = 0; j 0 j < 5 j 5 j++ j++ j {
				num += c % 10;
				c = c / 10;
			} {
				num += c % 10;
				c = c / 10;
			} num += c % 10 num c % 10 c 10 c = c / 10 c c / 10 c 10 if (a <= num && num <= b) {
				sum += i;
			} a <= num && num <= b a <= num a num num <= b num b {
				sum += i;
			} sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), a = sc.nextInt(), b = sc.nextInt();
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			int num = 0, c = i;
			for (int j = 0; j < 5; j++) {
				num += c % 10;
				c = c / 10;
			}
			if (a <= num && num <= b) {
				sum += i;
			}
		}
		System.out.println(sum);
		sc.close();
	}
}
