import java.util.*;

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 answer = 0;
    for (int i = 1; i <= n; i++) {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    }
    System.out.println(answer);
  }
} import java.util.*; util.* java 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 answer = 0;
    for (int i = 1; i <= n; i++) {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    }
    System.out.println(answer);
  }
} 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 answer = 0;
    for (int i = 1; i <= n; i++) {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    }
    System.out.println(answer);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    int answer = 0;
    for (int i = 1; i <= n; i++) {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    }
    System.out.println(answer);
  } 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 answer = 0; answer 0 for (int i = 1; i <= n; i++) {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    } {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    } int num = i; num i int sum = 0; sum 0 while(num > 0) {
        sum += num % 10;
        num /= 10;
      } num > 0 num 0 {
        sum += num % 10;
        num /= 10;
      } sum += num % 10 sum num % 10 num 10 num /= 10 num 10 if (a <= sum && sum <= b) {
        answer += i;
      } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
        answer += i;
      } answer += i answer i System.out.println(answer) System.out.println System.out System System.out answer String[] args args
import java.util.*;

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 answer = 0;
    for (int i = 1; i <= n; i++) {
      int num = i;
      int sum = 0;
      while(num > 0) {
        sum += num % 10;
        num /= 10;
      }
      if (a <= sum && sum <= b) {
        answer += i;
      }
    }
    System.out.println(answer);
  }
}