import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	}

} Main public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	} main {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan int sum = 0; sum 0 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 } {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 } int keta = Integer.toString(i).length(); keta Integer.toString(i).length() Integer.toString(i).length Integer.toString(i) Integer.toString Integer i int wk = i wk i sum_digit = 0; sum_digit 0 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 } int j = keta; int j = keta; j keta j > 0 j 0 j-- j-- j {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 } {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 } sum_digit += wk / (int)(Math.pow(10,j-1)) sum_digit wk / (int)(Math.pow(10,j-1)) wk (int)(Math.pow(10,j-1)) Math.pow Math 10 j-1 j 1 wk = wk % (int)(Math.pow(10,j-1)) wk wk % (int)(Math.pow(10,j-1)) wk (int)(Math.pow(10,j-1)) Math.pow Math 10 j-1 j 1 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 } sum_digit >= A && sum_digit <= B sum_digit >= A sum_digit A sum_digit <= B sum_digit B {
				 sum += i;
			 } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	}

} public class Main {

	public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int N = scan.nextInt();
		 int A = scan.nextInt();
		 int B = scan.nextInt();
		 
		 int sum = 0;
		 for (int i = 1; i <= N; i++) {
			 int keta = Integer.toString(i).length();
			 
			 int wk = i,sum_digit = 0;
			 for (int j = keta; j > 0; j--) {
				 sum_digit += wk / (int)(Math.pow(10,j-1));
				 wk = wk % (int)(Math.pow(10,j-1));
			 }
			 
			 if (sum_digit >= A && sum_digit <= B) {
				 sum += i;
			 }
		 }
		 
		 System.out.println(sum);
		 
		 scan.close();

	}

}
