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 answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	}

	private static int calcDigitSum(int i) {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	}
} 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 answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	}

	private static int calcDigitSum(int i) {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	}
} 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 answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	} 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 answer = 0; answer 0 for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		} int i =1; int i =1; i 1 i <= n i n i++ i++ i {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		} {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		} int digitSum = calcDigitSum(i); digitSum calcDigitSum(i) calcDigitSum i if(digitSum >= a && digitSum <= b) {
				answer+= i;
			} digitSum >= a && digitSum <= b digitSum >= a digitSum a digitSum <= b digitSum b {
				answer+= i;
			} answer+= i answer i System.out.println(answer) System.out.println System.out System System.out answer String[] args args private static int calcDigitSum(int i) {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	} calcDigitSum {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	} String[] digitArray = String.valueOf(i).split(""); digitArray String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" int result = 0; result 0 for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		} String digit digitArray {
			result += Integer.parseInt(digit);
		} {
			result += Integer.parseInt(digit);
		} result += Integer.parseInt(digit) result Integer.parseInt(digit) Integer.parseInt Integer digit return result; result int i i 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 answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	}

	private static int calcDigitSum(int i) {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	}
} 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 answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	}

	private static int calcDigitSum(int i) {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	}
} 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 answer = 0;
		for(int i =1;i <= n;i++) {
			int digitSum = calcDigitSum(i);
			if(digitSum >= a && digitSum <= b) {
				answer+= i;
			}
		}
		System.out.println(answer);
	}

	private static int calcDigitSum(int i) {
		String[] digitArray = String.valueOf(i).split("");
		int result = 0;
		for(String digit : digitArray) {
			result += Integer.parseInt(digit);
		}
		return result;
	}
}