import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	} 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 = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	} 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 = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		} int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		} {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		} int target = i; target i int sum = 0; sum 0 while (target != 0) {
				sum += target % 10;
				target /= 10;
			} target != 0 target 0 {
				sum += target % 10;
				target /= 10;
			} sum += target % 10 sum target % 10 target 10 target /= 10 target 10 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 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = 0; i <= N; i++) {
			int target = i;
			int sum = 0;
			while (target != 0) {
				sum += target % 10;
				target /= 10;
			}
			if (sum >= A && sum <= B) {
				ans += i;
			}
		}
		System.out.println(ans);
		sc.close();
	}
}