import java.util.*;

public class Main {

	public static void main(String[] args) {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	}
} Main public static void main(String[] args) {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	} main {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	} int N = 0; N 0 int A = 0; A 0 int B = 0; B 0 int sum = 0; sum 0 int sumList = 0; sumList 0 List<Integer> intList = new ArrayList<Integer>(); intList new ArrayList<Integer>() Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner A = scanner.nextInt() A scanner.nextInt() scanner.nextInt scanner B = scanner.nextInt() B scanner.nextInt() scanner.nextInt scanner for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

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

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

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

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		} int j = i; j i while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			} j >= 1 j 1 {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			} sum = sum + (j % 10) sum sum + (j % 10) sum (j % 10) j 10 j = (int) Math.floor(j / 10) j (int) Math.floor(j / 10) Math.floor Math j / 10 j 10 if(A <= sum && sum <=B) {
				sumList = sumList + i;
			} A <= sum && sum <=B A <= sum A sum sum <=B sum B {
				sumList = sumList + i;
			} sumList = sumList + i sumList sumList + i sumList i sum = 0 sum 0 System.out.println(sumList) System.out.println System.out System System.out sumList String[] args args public class Main {

	public static void main(String[] args) {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	}
} public class Main {

	public static void main(String[] args) {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {


		int N = 0;
		int A = 0;
		int B = 0;
		int sum = 0;
		int sumList = 0;
		List<Integer> intList = new ArrayList<Integer>();

		Scanner scanner = new Scanner(System.in);

		N = scanner.nextInt();
		A = scanner.nextInt();
		B = scanner.nextInt();

		for(int i = 1; i <= N ; i++) {
			int j = i;

			while(j >= 1) {
				sum = sum + (j % 10);
				j = (int) Math.floor(j / 10);
			}

			if(A <= sum && sum <=B) {
				sumList = sumList + i;
			}
			sum = 0;
		}
		System.out.println(sumList);
	}
}
