
import java.util.*;

public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  }

  static int sum(int tmp) {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  }

  static int sum(int tmp) {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  }
} Main public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  } main {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  } @SuppressWarnings("resource")
    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 sum = 0; sum 0 for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    } {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    } int tmpSum = sum(i); tmpSum sum(i) sum i sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum sum (A <= tmpSum && tmpSum <= B) ? sum + i : sum (A <= tmpSum && tmpSum <= B) A <= tmpSum A tmpSum tmpSum <= B tmpSum B sum + i sum i sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args static int sum(int tmp) {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  } sum {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  } int ret = 0; ret 0 while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    } tmp > 0 tmp 0 {
      ret += tmp % 10;
      tmp = tmp / 10;
    } ret += tmp % 10 ret tmp % 10 tmp 10 tmp = tmp / 10 tmp tmp / 10 tmp 10 return ret; ret int tmp tmp public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  }

  static int sum(int tmp) {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  }
} public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  }

  static int sum(int tmp) {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  }
} Main

import java.util.*;

public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int N  = sc.nextInt();
    int A  = sc.nextInt();
    int B  = sc.nextInt();
    int sum = 0;

    for (int i = 1; i <= N; i++) {
      int tmpSum = sum(i);
      sum = (A <= tmpSum && tmpSum <= B) ? sum + i : sum;
    }
    
    System.out.println(sum);
  }

  static int sum(int tmp) {
    int ret = 0;
    while (tmp > 0) {
      ret += tmp % 10;
      tmp = tmp / 10;
    }
    return ret;
  }
}
