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 ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  }
} 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 ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  }
} 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 ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    int ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  } 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 ans = 0; ans 0 for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    } {
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    } String iStr = String.valueOf(i); iStr String.valueOf(i) String.valueOf String i String[] iSpl = iStr.split(""); iSpl iStr.split("") iStr.split iStr "" int[] iInt = new int[iSpl.length]; iInt new int[iSpl.length] iSpl.length iSpl iSpl.length int sum = 0; sum 0 for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      } int j=0; int j=0; j 0 j<iSpl.length j iSpl.length iSpl iSpl.length j++ j++ j {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      } {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      } iInt[j] = Integer.parseInt(iSpl[j]) iInt[j] iInt j Integer.parseInt(iSpl[j]) Integer.parseInt Integer iSpl[j] iSpl j sum = sum + iInt[j] sum sum + iInt[j] sum iInt[j] iInt j if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      } (sum>=A)&&(sum<=B) (sum>=A) sum A (sum<=B) sum B {
        ans = ans + i;
      } ans = ans + i ans ans + i ans i System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  }
} 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 ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  }
} 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 ans = 0;
    for (int i=1;i<=N;i++){
      String iStr = String.valueOf(i);
      String[] iSpl = iStr.split("");
      int[] iInt = new int[iSpl.length];
      int sum = 0;
      for (int j=0;j<iSpl.length;j++) {
        iInt[j] = Integer.parseInt(iSpl[j]);
        sum = sum + iInt[j];
      }
      if ((sum>=A)&&(sum<=B)) {
        ans = ans + i;
      }
    }
    System.out.println(ans);
  }
}