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();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      System.out.println(sum);
  }

  private static boolean digitSum(int n, int a, int b) {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  }
} 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();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      System.out.println(sum);
  }

  private static boolean digitSum(int n, int a, int b) {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  }
} 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();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      System.out.println(sum);
  } main { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int a = sc.nextInt();
      int b = sc.nextInt();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      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 long sum  = 0; sum 0 for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        if(digitSum(i, a, b))
          sum += i;
      } {
        if(digitSum(i, a, b))
          sum += i;
      } if(digitSum(i, a, b))
          sum += i; digitSum(i, a, b) digitSum i a b sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args private static boolean digitSum(int n, int a, int b) {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  } digitSum {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  } int sum = 0; sum 0 while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    } n > 0 n 0 {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 if(sum > b) return false; sum > b sum b return false; false return sum >= a; sum >= a sum a int n n int a a int b b 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();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      System.out.println(sum);
  }

  private static boolean digitSum(int n, int a, int b) {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  }
} 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();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      System.out.println(sum);
  }

  private static boolean digitSum(int n, int a, int b) {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  }
} 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();
      long sum  = 0;

      for(int i = 1; i <= n; i++) {
        if(digitSum(i, a, b))
          sum += i;
      }
      System.out.println(sum);
  }

  private static boolean digitSum(int n, int a, int b) {
    int sum = 0;
    while(n > 0) {
      sum += n % 10;
      n /= 10;
      if(sum > b) return false;
    }

    return sum >= a;
  }
}