import java.util.*;
 
class Main {
  
   public static int findSumOfDigits (int n){
     int sum = 0;
     while(n>0){
       sum += n%10;
       n = n/10;
     } 
     return sum;
   }
  
  
    public static void main(String[] args) {
      
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int total = 0;
      
      for(int i = 1;i<=N;i++){
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      }
		System.out.print(total);
    }
} import java.util.*; util.* java class Main {
  
   public static int findSumOfDigits (int n){
     int sum = 0;
     while(n>0){
       sum += n%10;
       n = n/10;
     } 
     return sum;
   }
  
  
    public static void main(String[] args) {
      
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int total = 0;
      
      for(int i = 1;i<=N;i++){
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      }
		System.out.print(total);
    }
} Main public static int findSumOfDigits (int n){
     int sum = 0;
     while(n>0){
       sum += n%10;
       n = n/10;
     } 
     return sum;
   } findSumOfDigits {
     int sum = 0;
     while(n>0){
       sum += n%10;
       n = n/10;
     } 
     return sum;
   } int sum = 0; sum 0 while(n>0){
       sum += n%10;
       n = n/10;
     } n>0 n 0 {
       sum += n%10;
       n = n/10;
     } sum += n%10 sum n%10 n 10 n = n/10 n n/10 n 10 return sum; sum int n n public static void main(String[] args) {
      
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int total = 0;
      
      for(int i = 1;i<=N;i++){
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      }
		System.out.print(total);
    } main {
      
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int total = 0;
      
      for(int i = 1;i<=N;i++){
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      }
		System.out.print(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int total = 0; total 0 for(int i = 1;i<=N;i++){
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      } int i = 1; int i = 1; i 1 i<=N i N i++ i++ i {
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      } {
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      } int sum = findSumOfDigits(i); sum findSumOfDigits(i) findSumOfDigits i if(A<=sum&&sum<=B){
          total = total + i;
        } A<=sum&&sum<=B A<=sum A sum sum<=B sum B {
          total = total + i;
        } total = total + i total total + i total i System.out.print(total) System.out.print System.out System System.out total String[] args args
import java.util.*;
 
class Main {
  
   public static int findSumOfDigits (int n){
     int sum = 0;
     while(n>0){
       sum += n%10;
       n = n/10;
     } 
     return sum;
   }
  
  
    public static void main(String[] args) {
      
      
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int total = 0;
      
      for(int i = 1;i<=N;i++){
        int sum = findSumOfDigits(i);
        if(A<=sum&&sum<=B){
          total = total + i;
        }
      }
		System.out.print(total);
    }
}