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;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  }

} 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;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  }

} 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;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();

    int total = 0;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  } 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 int sum = 0; sum 0 for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    } {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    } String k = String.valueOf(i); k String.valueOf(i) String.valueOf String i for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      } int j = 0; int j = 0; j 0 j < k.length() j k.length() k.length k j++ j++ j {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      } {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      } String x = String.valueOf(k.charAt(j)); x String.valueOf(k.charAt(j)) String.valueOf String k.charAt(j) k.charAt k j int y = Integer.parseInt(x); y Integer.parseInt(x) Integer.parseInt Integer x total += y total y if (total >= a && total <= b) {
        sum += i;
      } total >= a && total <= b total >= a total a total <= b total b {
        sum += i;
      } sum += i sum i total = 0 total 0 System.out.println(sum) System.out.println System.out System System.out sum 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;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  }

} 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;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  }

} 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;
    int sum = 0;

    for (int i = 0; i <= n; i++) {
      String k = String.valueOf(i);
      for (int j = 0; j < k.length(); j++) {
        String x = String.valueOf(k.charAt(j));
        int y = Integer.parseInt(x);
        total += y;
      }
      if (total >= a && total <= b) {
        sum += i;
      }
      total = 0;
    }

    System.out.println(sum);

  }

}
