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 answer =0;
    for(int i=1;i<=N;i++){
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    }
    System.out.println(answer);
  }
  
  public static boolean isRange(int n ,int min ,int max){
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  }
  

  
} 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 answer =0;
    for(int i=1;i<=N;i++){
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    }
    System.out.println(answer);
  }
  
  public static boolean isRange(int n ,int min ,int max){
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  }
  

  
} 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++){
      if(isRange(i,A,B)){
        answer = 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++){
      if(isRange(i,A,B)){
        answer = 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++){
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    } int i=1; int i=1; i 1 i<=N i N i++ i++ i {
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    } {
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    } if(isRange(i,A,B)){
        answer = answer+i;
      } isRange(i,A,B) isRange i A B {
        answer = answer+i;
      } answer = answer+i answer answer+i answer i System.out.println(answer) System.out.println System.out System System.out answer String[] args args public static boolean isRange(int n ,int min ,int max){
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  } isRange {
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  } int cnt1=n%10; cnt1 n%10 n 10 int cnt10=(n/10)%10; cnt10 (n/10)%10 (n/10) n 10 10 int cnt100 =(n/100)%10; cnt100 (n/100)%10 (n/100) n 100 10 int cnt1000 =(n/1000)%10; cnt1000 (n/1000)%10 (n/1000) n 1000 10 int cnt10000=n/10000; cnt10000 n/10000 n 10000 int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000; sums cnt1+cnt10+cnt100+cnt1000+cnt10000 cnt1000 cnt100 cnt1+cnt10+cnt100+cnt1000+cnt10000 cnt1 cnt10 cnt100 cnt1000 cnt10000 if(min<=sums&&sums<=max){
      return true;
    } min<=sums&&sums<=max min<=sums min sums sums<=max sums max {
      return true;
    } return true; true return false; false int n n int min min int max max 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 answer =0;
    for(int i=1;i<=N;i++){
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    }
    System.out.println(answer);
  }
  
  public static boolean isRange(int n ,int min ,int max){
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  }
  

  
} 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 answer =0;
    for(int i=1;i<=N;i++){
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    }
    System.out.println(answer);
  }
  
  public static boolean isRange(int n ,int min ,int max){
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  }
  

  
} 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 answer =0;
    for(int i=1;i<=N;i++){
      if(isRange(i,A,B)){
        answer = answer+i;
      }
    }
    System.out.println(answer);
  }
  
  public static boolean isRange(int n ,int min ,int max){
    int cnt1=n%10;
    int cnt10=(n/10)%10;
    int cnt100 =(n/100)%10;
    int cnt1000 =(n/1000)%10;
    int cnt10000=n/10000;
    int sums = cnt1+cnt10+cnt100+cnt1000+cnt10000;
    if(min<=sums&&sums<=max){
      return true;
    }
    return false;
  }
  

  
}