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 result = 0;
    
    for(int i = 1; i <= n; i++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= b){
        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 n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    
    int result = 0;
    
    for(int i = 1; i <= n; i++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= 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++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= 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++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= 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++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= b){
        result += i;
      }
      
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= b){
        result += i;
      }
      
    } {
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= b){
        result += i;
      }
      
    } int sum = 0; sum 0 for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      } char num String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i {
        sum += Integer.parseInt(String.valueOf(num));
      } {
        sum += Integer.parseInt(String.valueOf(num));
      } sum += Integer.parseInt(String.valueOf(num)) sum Integer.parseInt(String.valueOf(num)) Integer.parseInt Integer String.valueOf(num) String.valueOf String num if(sum >= a && sum <= b){
        result += i;
      } sum >= a && sum <= b sum >= a sum a sum <= b sum 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++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= 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++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= b){
        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 n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    
    int result = 0;
    
    for(int i = 1; i <= n; i++){
      
      int sum = 0;

      // 各桁のループ
      for(char num : String.valueOf(i).toCharArray()){
        sum += Integer.parseInt(String.valueOf(num));
      }
      
      if(sum >= a && sum <= b){
        result += i;
      }
      
    }
    
    System.out.println(result);

  }

}