import java.util.*;

class Main{
  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 finalSum = 0;
    
    for(int i = 1; i <= N; i++){
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    }
    System.out.println(finalSum);
  }
}
       import java.util.*; util.* java class Main{
  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 finalSum = 0;
    
    for(int i = 1; i <= N; i++){
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    }
    System.out.println(finalSum);
  }
} Main 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 finalSum = 0;
    
    for(int i = 1; i <= N; i++){
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    }
    System.out.println(finalSum);
  } 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 finalSum = 0;
    
    for(int i = 1; i <= N; i++){
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    }
    System.out.println(finalSum);
  } 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 finalSum = 0; finalSum 0 for(int i = 1; i <= N; i++){
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    } {
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    } int c = i; c i int sum = 0; sum 0 while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      } c > 0 c 0 {//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      } sum = sum + c % 10 sum sum + c % 10 sum c % 10 c 10 c = c / 10 c c / 10 c 10 if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      } sum <= B && A <= sum sum <= B sum B A <= sum A sum {
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      } finalSum = finalSum + i finalSum finalSum + i finalSum i System.out.println(finalSum) System.out.println System.out System System.out finalSum String[] args args
import java.util.*;

class Main{
  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 finalSum = 0;
    
    for(int i = 1; i <= N; i++){
      int c = i;
      int sum = 0;
      while(c > 0){//cの全ての桁を見終えたとき
        sum = sum + c % 10;
        c = c / 10;
      }
      if(sum <= B && A <= sum){
      	//finalSum = finalSum + sum;
        //finalSum = finalSum + c;
        finalSum = finalSum + i;
      }
    }
    System.out.println(finalSum);
  }
}
      