import java.util.Scanner;

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;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  }
} import java.util.Scanner; Scanner 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;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  }
} 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;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    int ans = 0;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  } 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 int sum = 0; sum 0 for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    } int cnt = 0; int cnt = 0; cnt 0 cnt <= n cnt n cnt++ cnt++ cnt {
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    } {
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    } int tmp = cnt; tmp cnt while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      } tmp != 0 tmp 0 {
        sum += tmp % 10;
        tmp /= 10; 
      } sum += tmp % 10 sum tmp % 10 tmp 10 tmp /= 10 tmp 10 if ( a <= sum && sum <= b){
        ans+= cnt;
      } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
        ans+= cnt;
      } ans+= cnt ans cnt sum = 0 sum 0 tmp = 0 tmp 0 System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  }
} 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;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  }
} Main
import java.util.Scanner;

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;
    int sum = 0;
    for(int cnt = 0; cnt <= n; cnt++){
      int tmp = cnt;
      while(tmp != 0){
        sum += tmp % 10;
        tmp /= 10; 
      }
      if ( a <= sum && sum <= b){
        ans+= cnt;
      }
      sum = 0;
      tmp = 0;
    }
    System.out.println(ans);
    sc.close();
  }
}