import java.util.Scanner;

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

    int ans = 0;
    int n = stdIn.nextInt();
    int a = stdIn.nextInt();
    int b = stdIn.nextInt();

    for (int i = 1; i <= n; i++) {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    }

    System.out.println(ans);
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int ans = 0;
    int n = stdIn.nextInt();
    int a = stdIn.nextInt();
    int b = stdIn.nextInt();

    for (int i = 1; i <= n; i++) {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    }

    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);

    int ans = 0;
    int n = stdIn.nextInt();
    int a = stdIn.nextInt();
    int b = stdIn.nextInt();

    for (int i = 1; i <= n; i++) {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    }

    System.out.println(ans);
  } main {
    Scanner stdIn = new Scanner(System.in);

    int ans = 0;
    int n = stdIn.nextInt();
    int a = stdIn.nextInt();
    int b = stdIn.nextInt();

    for (int i = 1; i <= n; i++) {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    }

    System.out.println(ans);
  } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int ans = 0; ans 0 int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn int b = stdIn.nextInt(); b stdIn.nextInt() stdIn.nextInt stdIn for (int i = 1; i <= n; i++) {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    } {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    } int sum = 0; sum 0 String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String[] str = s.split(""); str s.split("") s.split s "" for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      } int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
        sum += Integer.parseInt(str[j]);
      } {
        sum += Integer.parseInt(str[j]);
      } sum += Integer.parseInt(str[j]) sum Integer.parseInt(str[j]) Integer.parseInt Integer str[j] str j if (sum >= a && sum <= b) {
        ans += i;
      } sum >= a && sum <= b sum >= a sum a sum <= b sum b {
        ans += i;
      } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Scanner;

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

    int ans = 0;
    int n = stdIn.nextInt();
    int a = stdIn.nextInt();
    int b = stdIn.nextInt();

    for (int i = 1; i <= n; i++) {
      int sum = 0;
      String s = String.valueOf(i);
      String[] str = s.split("");
      for (int j = 0; j < s.length(); j++) {
        sum += Integer.parseInt(str[j]);
      }
      if (sum >= a && sum <= b) {
        ans += i;
      }
    }

    System.out.println(ans);
  }
}
