import java.util.ArrayList;
import java.util.List;
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 result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(result);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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 result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(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 result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(result);
	} main {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		int result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(result);
	} 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 result = 0; result 0 for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		} {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		} List<Integer> list = new ArrayList<>(); list new ArrayList<>() int cnt = i; cnt i while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			} cnt > 0 cnt 0 {
				list.add(cnt%10);
				cnt /= 10;
			} list.add(cnt%10) list.add list cnt%10 cnt 10 cnt /= 10 cnt 10 int lcnt = 0; lcnt 0 for (int l : list) {
				lcnt += l;
			} int l list {
				lcnt += l;
			} {
				lcnt += l;
			} lcnt += l lcnt l if (lcnt >= a && lcnt <= b) {
				result += i;
			} lcnt >= a && lcnt <= b lcnt >= a lcnt a lcnt <= b lcnt b {
				result += i;
			} result += i result i System.out.println(result) System.out.println System.out System System.out result 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 result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(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 result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(result);
	}
} Main
import java.util.ArrayList;
import java.util.List;
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 result = 0;

		for (int i = 1; i <= n; i++) {
			List<Integer> list = new ArrayList<>();
			int cnt = i;
			while(cnt > 0) {
				list.add(cnt%10);
				cnt /= 10;
			}
			
			int lcnt = 0;
			for (int l : list) {
				lcnt += l;
			}
			
			if (lcnt >= a && lcnt <= b) {
				result += i;
			}
		}
		System.out.println(result);
	}
}