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();
    
    int ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  }
} 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();
    
    int ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  }
} 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 ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    
    int ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  } 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 ans = 0; ans 0 for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    } {
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    } int sum = 0; sum 0 String s = i + ""; s i + "" i "" for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      } int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
        char c = s.charAt(j);
        sum += (c - '0');
      } {
        char c = s.charAt(j);
        sum += (c - '0');
      } char c = s.charAt(j); c s.charAt(j) s.charAt s j sum += (c - '0') sum (c - '0') c '0' if(sum >= A && sum <= B){
        ans += i;
      } sum >= A && sum <= B sum >= A sum A sum <= B sum B {
        ans += i;
      } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans 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();
    
    int ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  }
} 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();
    
    int ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  }
} 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();
    
    int ans = 0;
    for(int i = 1; i <= N; i++){
      int sum = 0;
      String s = i + "";
      for(int j = 0; j < s.length(); j++){
        char c = s.charAt(j);
        sum += (c - '0');
      }
      if(sum >= A && sum <= B){
        ans += i;
      }
    }
    
    System.out.println(ans);
  }
}