import java.util.*;
class Main{

     public static void main(String []args){
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt() ;
      int a = scan.nextInt() ;
      int b = scan.nextInt() ;
      int sum = 0;
      
      for(int i = 1 ; i<=n; i++){
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      }
      System.out.println(sum);
      
     
      
    }
} import java.util.*; util.* java class Main{

     public static void main(String []args){
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt() ;
      int a = scan.nextInt() ;
      int b = scan.nextInt() ;
      int sum = 0;
      
      for(int i = 1 ; i<=n; i++){
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      }
      System.out.println(sum);
      
     
      
    }
} Main public static void main(String []args){
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt() ;
      int a = scan.nextInt() ;
      int b = scan.nextInt() ;
      int sum = 0;
      
      for(int i = 1 ; i<=n; i++){
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      }
      System.out.println(sum);
      
     
      
    } main {
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt() ;
      int a = scan.nextInt() ;
      int b = scan.nextInt() ;
      int sum = 0;
      
      for(int i = 1 ; i<=n; i++){
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      }
      System.out.println(sum);
      
     
      
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt() ; n scan.nextInt() scan.nextInt scan int a = scan.nextInt() ; a scan.nextInt() scan.nextInt scan int b = scan.nextInt() ; b scan.nextInt() scan.nextInt scan int sum = 0; sum 0 for(int i = 1 ; i<=n; i++){
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      } int i = 1 ; int i = 1 ; i 1 i<=n i n i++ i++ i {
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      } {
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      } String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i char[] c = s.toCharArray(); c s.toCharArray() s.toCharArray s int [] arr = new int[c.length]; arr new int[c.length] c.length c c.length int sm = 0 ; sm 0 for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          } int j = 0 ; int j = 0 ; j 0 j<c.length j c.length c c.length j++ j++ j {
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          } {
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          } arr[j]= Character.getNumericValue(c[j]) arr[j] arr j Character.getNumericValue(c[j]) Character.getNumericValue Character c[j] c j sm+=arr[j] sm arr[j] arr j if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          } sm>=a && sm<=b sm>=a sm a sm<=b sm b {
              //System.out.println(i);
              sum+=i;
          } sum+=i sum i System.out.println(sum) System.out.println System.out System System.out sum String []args args
import java.util.*;
class Main{

     public static void main(String []args){
      Scanner scan = new Scanner(System.in);
      int n = scan.nextInt() ;
      int a = scan.nextInt() ;
      int b = scan.nextInt() ;
      int sum = 0;
      
      for(int i = 1 ; i<=n; i++){
          String s = Integer.toString(i);
          
          char[] c = s.toCharArray();
          int [] arr = new int[c.length];
          int sm = 0 ;
         for(int j = 0 ; j<c.length ; j++){
              arr[j]= Character.getNumericValue(c[j]) ;
              sm+=arr[j] ;
          }
          //System.out.println(sm);
          if(sm>=a && sm<=b){
              //System.out.println(i);
              sum+=i;
          }
      }
      System.out.println(sum);
      
     
      
    }
}