import java.util.Scanner;

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();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  }
  
  private static int dsum(int a) {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  }
} import java.util.Scanner; Scanner 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();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  }
  
  private static int dsum(int a) {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  }
} 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();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  } main {
    Scanner scanner = new Scanner(System.in);
    
    int N = scanner.nextInt();
    int A = scanner.nextInt();
    int B = scanner.nextInt();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  } 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 long sum = 0; sum 0 for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    } {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    } int dsum = dsum(i); dsum dsum(i) dsum i if (dsum >= A && dsum <= B) sum += i; dsum >= A && dsum <= B dsum >= A dsum A dsum <= B dsum B sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args private static int dsum(int a) {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  } dsum {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  } int t = 0; t 0 while (a > 0) {
      t += a % 10;
      a /= 10;
    } a > 0 a 0 {
      t += a % 10;
      a /= 10;
    } t += a % 10 t a % 10 a 10 a /= 10 a 10 return t; t int a a 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();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  }
  
  private static int dsum(int a) {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  }
} 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();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  }
  
  private static int dsum(int a) {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  }
} Main
import java.util.Scanner;

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();
    long sum = 0;
    for (int i = 1; i <= N; i++) {
      int dsum = dsum(i);
      if (dsum >= A && dsum <= B) sum += i;
    }
    System.out.println(sum);
  }
  
  private static int dsum(int a) {
    int t = 0;
    while (a > 0) {
      t += a % 10;
      a /= 10;
    }
    return t;
  }
}