import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

    scanner.close();
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

    scanner.close();
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

    scanner.close();
  } main {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

    scanner.close();
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int all = 0; all 0 for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    } int x = 1; int x = 1; x 1 x <= n x n x++ x++ x {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    } {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    } int sum = 0; sum 0 for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      } String number String.valueOf(x).split("") String.valueOf(x).split String.valueOf(x) String.valueOf String x "" {
        sum += Integer.parseInt(number);
      } {
        sum += Integer.parseInt(number);
      } sum += Integer.parseInt(number) sum Integer.parseInt(number) Integer.parseInt Integer number if (a <= sum && sum <= b) {
        all += x;

      } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
        all += x;

      } all += x all x System.out.println(all) System.out.println System.out System System.out all scanner.close() scanner.close scanner String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

    scanner.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

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

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int a = scanner.nextInt();
    int b = scanner.nextInt();

    int all = 0;

    for (int x = 1; x <= n; x++) {
      int sum = 0;

      for (String number : String.valueOf(x).split("")) {
        sum += Integer.parseInt(number);
      }


      if (a <= sum && sum <= b) {
        all += x;

      }

    }

    System.out.println(all);

    scanner.close();
  }
}
