import java.util.Scanner;

class Main{
  public static void main(String[]args){
    Scanner scanner = new Scanner(System.in);

    // xが最大値、各桁の和がa以上b以下のものの総和を求める
    int x = scanner.nextInt(), a = scanner.nextInt(), b = scanner.nextInt();

    int ammount = 0;
    for(int i = 1; i <= x;i++){
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    }
    System.out.println(ammount);
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[]args){
    Scanner scanner = new Scanner(System.in);

    // xが最大値、各桁の和がa以上b以下のものの総和を求める
    int x = scanner.nextInt(), a = scanner.nextInt(), b = scanner.nextInt();

    int ammount = 0;
    for(int i = 1; i <= x;i++){
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    }
    System.out.println(ammount);
  }
} Main public static void main(String[]args){
    Scanner scanner = new Scanner(System.in);

    // xが最大値、各桁の和がa以上b以下のものの総和を求める
    int x = scanner.nextInt(), a = scanner.nextInt(), b = scanner.nextInt();

    int ammount = 0;
    for(int i = 1; i <= x;i++){
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    }
    System.out.println(ammount);
  } main {
    Scanner scanner = new Scanner(System.in);

    // xが最大値、各桁の和がa以上b以下のものの総和を求める
    int x = scanner.nextInt(), a = scanner.nextInt(), b = scanner.nextInt();

    int ammount = 0;
    for(int i = 1; i <= x;i++){
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    }
    System.out.println(ammount);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int x = scanner.nextInt() x scanner.nextInt() scanner.nextInt scanner a = scanner.nextInt() a scanner.nextInt() scanner.nextInt scanner b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int ammount = 0; ammount 0 for(int i = 1; i <= x;i++){
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    } int i = 1; int i = 1; i 1 i <= x i x i++ i++ i {
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    } {
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i char[] c_array = s.toCharArray(); c_array s.toCharArray() s.toCharArray s int sum = 0; sum 0 for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      } int j = 0; int j = 0; j 0 j < c_array.length j c_array.length c_array c_array.length j++ j++ j {
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      } {
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      } sum += Integer.parseInt(String.valueOf(c_array[j])) sum Integer.parseInt(String.valueOf(c_array[j])) Integer.parseInt Integer String.valueOf(c_array[j]) String.valueOf String c_array[j] c_array j if(a <= sum && sum <= b ){
        ammount += i;
      } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
        ammount += i;
      } ammount += i ammount i System.out.println(ammount) System.out.println System.out System System.out ammount String[]args args
import java.util.Scanner;

class Main{
  public static void main(String[]args){
    Scanner scanner = new Scanner(System.in);

    // xが最大値、各桁の和がa以上b以下のものの総和を求める
    int x = scanner.nextInt(), a = scanner.nextInt(), b = scanner.nextInt();

    int ammount = 0;
    for(int i = 1; i <= x;i++){
      String s = String.valueOf(i);
      char[] c_array = s.toCharArray();
      int sum = 0;
      for(int j = 0; j < c_array.length;j++){
        sum += Integer.parseInt(String.valueOf(c_array[j]));
      }
      if(a <= sum && sum <= b ){
        ammount += i;
      }
    }
    System.out.println(ammount);
  }
}