import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  } main {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int min = sc.nextInt(); min sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc int result = 0; result 0 for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	} int i = 1; int i = 1; i 1 i <= num i num i++ i++ i {
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	} {
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	} int j = i; j i int total = 0; total 0 while(j != 0){
			total = total + j %10;
			j = j/10;
		} j != 0 j 0 {
			total = total + j %10;
			j = j/10;
		} total = total + j %10 total total + j %10 total j %10 j 10 j = j/10 j j/10 j 10 if(min <= total && total <= max){
			result = result + i;
		} min <= total && total <= max min <= total min total total <= max total max {
			result = result + i;
		} result = result + i result 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 num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
	int min = sc.nextInt();
	int max = sc.nextInt();
	int result = 0;
	for(int i = 1; i <= num; i++){
      	int j = i;
		int total = 0;
		while(j != 0){
			total = total + j %10;
			j = j/10;
		}

		if(min <= total && total <= max){
			result = result + i;
		}
	}
    	System.out.println(result);
  }
}