import java.util.*;

public class Main {

  private static final int MAX_COUNT = 999;

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  }
} import java.util.*; util.* java public class Main {

  private static final int MAX_COUNT = 999;

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  }
} Main private static final int MAX_COUNT = 999; MAX_COUNT 999 public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  } main {
    Main m = new Main();
    m.exec();
  } Main m = new Main(); m new Main() m.exec() m.exec m String[] args args private void exec() {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  } exec {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  } 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 long total = 0; total 0 for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    } {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    } String value = String.valueOf(i); value String.valueOf(i) String.valueOf String i int sum = 0; sum 0 for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      } int j = 0; int j = 0; j 0 j < value.length() j value.length() value.length value j++ j++ j {
        sum += Integer.parseInt(value.substring(j, j + 1));
      } {
        sum += Integer.parseInt(value.substring(j, j + 1));
      } sum += Integer.parseInt(value.substring(j, j + 1)) sum Integer.parseInt(value.substring(j, j + 1)) Integer.parseInt Integer value.substring(j, j + 1) value.substring value j j + 1 j 1 if (sum >= a && sum <= b) {
        total += i;
      } sum >= a && sum <= b sum >= a sum a sum <= b sum b {
        total += i;
      } total += i total i System.out.println(total) System.out.println System.out System System.out total scan.close() scan.close scan public class Main {

  private static final int MAX_COUNT = 999;

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  }
} public class Main {

  private static final int MAX_COUNT = 999;

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  }
} Main
import java.util.*;

public class Main {

  private static final int MAX_COUNT = 999;

  public static void main(String[] args) {
    Main m = new Main();
    m.exec();
  }

  private void exec() {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int a = scan.nextInt();
    int b = scan.nextInt();

    long total = 0;
    for (int i = 1; i <= n; i++) {
      String value = String.valueOf(i);
      int sum = 0;
      for (int j = 0; j < value.length(); j++) {
        sum += Integer.parseInt(value.substring(j, j + 1));
      }
      if (sum >= a && sum <= b) {
        total += i;
      }
    }
    System.out.println(total);

    scan.close();
  }
}