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 sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  }
} 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 sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  }
} 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 sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    
    int sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  } 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 sum = 0; sum 0 int ichi = 0; ichi 0 int jyu = 0; jyu 0 int jyu_2 = 0; jyu_2 0 int jyu_3 = 0; jyu_3 0 int jyu_4 = 0; jyu_4 0 for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    } int i=1; int i=1; i 1 i<=n i n i++ i++ i {  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    } {  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    } ichi = i%10 ichi i%10 i 10 jyu = (i/10)%10 jyu (i/10)%10 (i/10) i 10 10 jyu_2 = (i/100)%10 jyu_2 (i/100)%10 (i/100) i 100 10 jyu_3 = (i/1000)%10 jyu_3 (i/1000)%10 (i/1000) i 1000 10 jyu_4 = (i/10000)%10 jyu_4 (i/10000)%10 (i/10000) i 10000 10 if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      } (a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b) (a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) a (ichi + jyu + jyu_2 + jyu_3 + jyu_4) jyu_3 jyu_2 ichi + jyu + jyu_2 + jyu_3 + jyu_4 ichi jyu jyu_2 jyu_3 jyu_4 ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b) (ichi + jyu + jyu_2 + jyu_3 + jyu_4) jyu_3 jyu_2 ichi + jyu + jyu_2 + jyu_3 + jyu_4 ichi jyu jyu_2 jyu_3 jyu_4 b {
        sum += i;
      } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum 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 sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  }
} 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 sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  }
} 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 sum = 0;
    int ichi = 0;
    int jyu = 0;
    int jyu_2 = 0;
    int jyu_3 = 0;
    int jyu_4 = 0;

    for(int i=1;i<=n;i++){  
      //1桁目
      ichi = i%10;
      //2から5桁目
      jyu = (i/10)%10;
      jyu_2 = (i/100)%10;
      jyu_3 = (i/1000)%10;
      jyu_4 = (i/10000)%10;
      
      if ((a <= (ichi + jyu + jyu_2 + jyu_3 + jyu_4)) && 
          ((ichi + jyu + jyu_2 + jyu_3 + jyu_4) <= b)){
        sum += i;
      }
    }
    
    System.out.println(sum);

  }
}