import java.util.*;

public class Main{
	public static void main(String[] args){
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  }
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  }
} Main public static void main(String[] args){
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  } main {
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int c = scanner.nextInt(); c scanner.nextInt() scanner.nextInt scanner int count=0; count 0 int compare=0; compare 0 for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      } int i = a; int i = a; i a i > 0 i 0 i-- i-- i {
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      } {
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      } compare = 0 compare 0 List<String> split = Arrays.asList(String.valueOf(i).split("")); split Arrays.asList(String.valueOf(i).split("")) Arrays.asList Arrays String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        } int j = 0; int j = 0; j 0 j < split.size() j split.size() split.size split j++ j++ j {
            compare += Integer.parseInt(split.get(j));
        } {
            compare += Integer.parseInt(split.get(j));
        } compare += Integer.parseInt(split.get(j)) compare Integer.parseInt(split.get(j)) Integer.parseInt Integer split.get(j) split.get split j if(b<= compare && compare <= c){
            count += i;
        } b<= compare && compare <= c b<= compare b compare compare <= c compare c {
            count += i;
        } count += i count i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
	public static void main(String[] args){
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  }
} public class Main{
	public static void main(String[] args){
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  }
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
      Scanner scanner = new Scanner(System.in);
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();
      
      int count=0;
      int compare=0;
      
      for(int i = a; i > 0 ; i--){
          compare = 0;
        
        List<String> split = Arrays.asList(String.valueOf(i).split(""));
        for(int j = 0; j < split.size(); j++ ){
            compare += Integer.parseInt(split.get(j));
        }
        
        if(b<= compare && compare <= c){
            count += i;
        }
      }
    System.out.println(count);
  }
}
