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 summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


	}
} 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 summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


	}
} 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 summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


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

		int summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


	} 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 summary = 0; summary 0 for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		} {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		} String numString = String.valueOf(i); numString String.valueOf(i) String.valueOf String i char[] numCharList = numString.toCharArray(); numCharList numString.toCharArray() numString.toCharArray numString int sum = 0; sum 0 for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			} char numChar numCharList {
				sum += Character.getNumericValue(numChar);
			} {
				sum += Character.getNumericValue(numChar);
			} sum += Character.getNumericValue(numChar) sum Character.getNumericValue(numChar) Character.getNumericValue Character numChar if (A <= sum && sum <= B) {
				summary += i;
			} A <= sum && sum <= B A <= sum A sum sum <= B sum B {
				summary += i;
			} summary += i summary i System.out.println(summary) System.out.println System.out System System.out summary 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 summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


	}
} 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 summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


	}
} 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 summary = 0;
		for (int i = 1; i <= N; i++) {
			String numString = String.valueOf(i);
			char[] numCharList = numString.toCharArray();
			int sum = 0;
			for (char numChar : numCharList) {
				sum += Character.getNumericValue(numChar);
			}
			if (A <= sum && sum <= B) {
				summary += i;
			}
		}
		System.out.println(summary);


	}
}
