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 cnt = 0;
		for (int i = 0; i <= N; i++) {
			int num = i;
			int sum = 0;
			while(num > 0) {
				sum += num % 10;
				num /= 10;
			}
			if(A <= sum && sum <= B) cnt += i;
		}
		System.out.print(cnt);
	}
} 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 cnt = 0;
		for (int i = 0; i <= N; i++) {
			int num = i;
			int sum = 0;
			while(num > 0) {
				sum += num % 10;
				num /= 10;
			}
			if(A <= sum && sum <= B) cnt += i;
		}
		System.out.print(cnt);
	}
} 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 cnt = 0;
		for (int i = 0; i <= N; i++) {
			int num = i;
			int sum = 0;
			while(num > 0) {
				sum += num % 10;
				num /= 10;
			}
			if(A <= sum && sum <= B) cnt += i;
		}
		System.out.print(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();

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