import java.util.Scanner;

public class Main {
  public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  }
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  }
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  }
} Main public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  } figure {
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  } int count=0; count 0 while(a>0){
      count += a%10;
      a = a/10;
    } a>0 a 0 {
      count += a%10;
      a = a/10;
    } count += a%10 count a%10 a 10 a = a/10 a a/10 a 10 return count; count int a a public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  } main {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n =  scan.nextInt(); n scan.nextInt() scan.nextInt scan int a =  scan.nextInt(); a scan.nextInt() scan.nextInt scan int b =  scan.nextInt(); b scan.nextInt() scan.nextInt scan int count =0; count 0 for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      } int i=1; int i=1; i 1 i<n+1 i n+1 n 1 i++ i++ i {
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      } {
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      } if(figure(i)>=a&&figure(i)<=b){
          count += i;
      } figure(i)>=a&&figure(i)<=b figure(i)>=a figure(i) figure i a figure(i)<=b figure(i) figure i b {
          count += i;
      } count += i count i System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String[] args args public class Main {
  public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  }
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  }
} public class Main {
  public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  }
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  }
} Main
import java.util.Scanner;

public class Main {
  public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  }
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  }
}
