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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= 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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= 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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= 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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= 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 total =0; total 0 for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= B) total += i;
    } int i=0; int i=0; i 0 i<N+1 i N+1 N 1 i++ i++ i {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= B) total += i;
    } {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= B) total += i;
    } int sum =0; sum 0 int a =i; a i while (a > 0) {
        sum += a % 10;
        a /= 10;
      } a > 0 a 0 {
        sum += a % 10;
        a /= 10;
      } sum += a % 10 sum a % 10 a 10 a /= 10 a 10 if (sum >= A && sum <= B) total += i; sum >= A && sum <= B sum >= A sum A sum <= B sum B 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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= 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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= 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 total =0;
    for (int i=0; i<N+1; i++) {
      int sum =0; 
      int a =i;
      while (a > 0) {
        sum += a % 10;
        a /= 10;
      }
      if (sum >= A && sum <= B) total += i;
    }
    System.out.println(total);
  }
}