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 totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	}

} 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 totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	}

} 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 totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();

		int totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	} 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 totalSum = 0; totalSum 0 for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		} int i=1; int i=1; i 1 i<=N i N i++ i++ i {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		} {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		} int sum = 0; sum 0 int num = i; num i while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			} num != 0 num 0 {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			} int hitoketame = num % 10; hitoketame num % 10 num 10 sum += hitoketame sum hitoketame num = num / 10 num num / 10 num 10 if (sum >= A && sum <= B) {
				totalSum += i;
			} sum >= A && sum <= B sum >= A sum A sum <= B sum B {
				totalSum += i;
			} totalSum += i totalSum i System.out.println(totalSum) System.out.println System.out System System.out totalSum 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 totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	}

} 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 totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	}

} 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 totalSum = 0;
		for (int i=1; i<=N; i++) {
			int sum = 0;

			int num = i;
			while (num != 0) {
				int hitoketame = num % 10;
				sum += hitoketame;
				num = num / 10;
			}

			if (sum >= A && sum <= B) {
				totalSum += i;
			}
		}

		System.out.println(totalSum);

	}

}
