import 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[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

		System.out.println(res);
	}
} import java.util.*; util.* java 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[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

		System.out.println(res);
	}
} 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[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

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

		int[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

		System.out.println(res);
	} 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[] n = new int[5]; n new int[5] 5 int res = 0; res 0 for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		} int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		} {
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		} int temp = i; temp i int sum = 0; sum 0 n[0] = temp / 10000 n[0] n 0 temp / 10000 temp 10000 temp %= 10000 temp 10000 n[1] = temp / 1000 n[1] n 1 temp / 1000 temp 1000 temp %= 1000 temp 1000 n[2] = temp / 100 n[2] n 2 temp / 100 temp 100 temp %= 100 temp 100 n[3] = temp / 10 n[3] n 3 temp / 10 temp 10 temp %= 10 temp 10 n[4] = temp n[4] n 4 temp for(int j = 0; j < 5; j++) sum += n[j]; int j = 0; int j = 0; j 0 j < 5 j 5 j++ j++ j sum += n[j]; sum += n[j] sum n[j] n j if(sum >= A && sum <= B) res += i; sum >= A && sum <= B sum >= A sum A sum <= B sum B res += i res i System.out.println(res) System.out.println System.out System System.out res 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[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

		System.out.println(res);
	}
} 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[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

		System.out.println(res);
	}
} Main
import 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[] n = new int[5];
		int res = 0;

		//System.out.printf("%d %d %d\n", N, A, B);

		for(int i = 1; i <= N; i++){
			int temp = i;
			int sum = 0;

			n[0] = temp / 10000;
			temp %= 10000;
			n[1] = temp / 1000;
			temp %= 1000;
			n[2] = temp / 100;
			temp %= 100;
			n[3] = temp / 10;
			temp %= 10;
			n[4] = temp;

			for(int j = 0; j < 5; j++) sum += n[j];
			if(sum >= A && sum <= B) res += i;
		}

		System.out.println(res);
	}
}
