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 count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  }
} 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 count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  }
} 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 count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  } main {
    Scanner sc = new Scanner(System.in);
    
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    int count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  } 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 count = 0; count 0 int total = 0; total 0 for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    } {
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    } int n=i; n i count = 0 count 0 while(n>0){
        count += n % 10;
        n = n / 10;
      } n>0 n 0 {
        count += n % 10;
        n = n / 10;
      } count += n % 10 count n % 10 n 10 n = n / 10 n n / 10 n 10 if(A<=count && count<=B){
        total += i;
      } A<=count && count<=B A<=count A count count<=B count B {
        total += i;
      } total += i total i System.out.println(total) System.out.println System.out System System.out total 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 count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  }
} 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 count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  }
} 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 count = 0;
    int total = 0;
    
    for(int i = 1; i <= N; i++){
      int n=i;
      count = 0;
      while(n>0){
        count += n % 10;
        n = n / 10;
      }
      if(A<=count && count<=B){
        total += i;
      }
 
    }
    System.out.println(total);
  }
}