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();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    System.out.println(sum);

  }

} 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();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    System.out.println(sum);

  }

} 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();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    System.out.println(sum);

  } main {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    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 sc.close() sc.close sc HashMap<Integer, Integer> hashMap = new HashMap<>(); hashMap new HashMap<>() for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    } {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String[] S = s.split(""); S s.split("") s.split s "" int sum = 0; sum 0 for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      } int j = 0; int j = 0; j 0 j < S.length j S.length S S.length j++ j++ j {
        sum += Integer.valueOf(S[j]);
      } {
        sum += Integer.valueOf(S[j]);
      } sum += Integer.valueOf(S[j]) sum Integer.valueOf(S[j]) Integer.valueOf Integer S[j] S j hashMap.put(i,sum) hashMap.put hashMap i sum int sum = 0; sum 0 for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    } Map.Entry<Integer, Integer> map hashMap.entrySet() hashMap.entrySet hashMap {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    } {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    } if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      } A <= map.getValue() && map.getValue() <= B A <= map.getValue() A map.getValue() map.getValue map map.getValue() <= B map.getValue() map.getValue map B {
        sum += map.getKey();
      } sum += map.getKey() sum map.getKey() map.getKey map System.out.println(sum) System.out.println System.out System System.out sum 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();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    System.out.println(sum);

  }

} 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();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    System.out.println(sum);

  }

} 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();

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    for (int i = 1; i <= N; i++) {
  
      // 各桁の合計を出す
      String s = String.valueOf(i);

      String[] S = s.split("");
    
      int sum = 0;
    
      for (int j = 0; j < S.length; j++) {
        sum += Integer.valueOf(S[j]);
      }

      hashMap.put(i,sum);
    
    }

    int sum = 0;

    for (Map.Entry<Integer, Integer> map : hashMap.entrySet()) {

      if (A <= map.getValue() && map.getValue() <= B){
        sum += map.getKey();
      }
      
    }

    System.out.println(sum);

  }

}