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();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	}
} 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();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	}
} 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();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	} 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 String[] str = new String[5]; str new String[5] 5 int len = 0; len 0 int answerSum = 0; answerSum 0 for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		} {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		} len = String.valueOf(i).length() len String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i str = String.valueOf(i).split("") str String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" int digitSum = 0; digitSum 0 for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			} int j = 0; int j = 0; j 0 j < len j len j++ j++ j {
				digitSum += Integer.valueOf(str[j]);
			} {
				digitSum += Integer.valueOf(str[j]);
			} digitSum += Integer.valueOf(str[j]) digitSum Integer.valueOf(str[j]) Integer.valueOf Integer str[j] str j if (A <= digitSum && digitSum <= B) answerSum += i; A <= digitSum && digitSum <= B A <= digitSum A digitSum digitSum <= B digitSum B answerSum += i answerSum i System.out.println(answerSum) System.out.println System.out System System.out answerSum 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();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	}
} 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();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	}
} 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();
		String[] str = new String[5];
		int len = 0;
		int answerSum = 0;

		for (int i = 1; i <= N; i++) {
			len = String.valueOf(i).length();
			str = String.valueOf(i).split("");
			int digitSum = 0;
			for (int j = 0; j < len; j++) {
				digitSum += Integer.valueOf(str[j]);
			}
			if (A <= digitSum && digitSum <= B) answerSum += i;
		}

		System.out.println(answerSum);
	}
}
