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 ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
}
 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 ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
} 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 ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	} 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 ans = 0; ans 0 for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		} {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		} String[] s = String.valueOf(i).split(""); s String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" int sum = 0; sum 0 for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			} int j = 0; int j = 0; j 0 j < s.length j s.length s s.length j++ j++ j {
				sum += Integer.parseInt(s[j]);
			} {
				sum += Integer.parseInt(s[j]);
			} sum += Integer.parseInt(s[j]) sum Integer.parseInt(s[j]) Integer.parseInt Integer s[j] s j if (sum >= A && sum <= B) {
				ans += i;
			} sum >= A && sum <= B sum >= A sum A sum <= B sum B {
				ans += i;
			} ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
} 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 ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
} 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 ans = 0;
		for (int i = 1; i <= N; i++) {
			String[] s = String.valueOf(i).split("");
			int sum = 0;
			for (int j = 0; j < s.length; j++) {
				sum += Integer.parseInt(s[j]);
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
	}
}

