import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  }

  private static int getXxx(int num) {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  }
}	 import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  }

  private static int getXxx(int num) {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  } main {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int end = sc.nextInt(); end sc.nextInt() sc.nextInt sc int min = sc.nextInt(); min sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc sc.close() sc.close sc long sum = 0; sum 0 for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    } int i = 1; int i = 1; i 1 i <= end i end i++ i++ i {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    } {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    } int x = getXxx(i); x getXxx(i) getXxx i if (min <= x && x <= max) {
        sum += i;
      } min <= x && x <= max min <= x min x x <= max x max {
        sum += i;
      } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[] args args private static int getXxx(int num) {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  } getXxx {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  } int result = 0; result 0 while(num > 0) {
      result += num % 10;
      num /= 10;
    } num > 0 num 0 {
      result += num % 10;
      num /= 10;
    } result += num % 10 result num % 10 num 10 num /= 10 num 10 return result; result int num num public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  }

  private static int getXxx(int num) {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  }

  private static int getXxx(int num) {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int end = sc.nextInt();
    int min = sc.nextInt();
    int max = sc.nextInt();
    sc.close();

    long sum = 0;

    for (int i = 1; i <= end; i++) {
      int x = getXxx(i);

      if (min <= x && x <= max) {
        sum += i;
      }
    }

    System.out.println(sum);
    
  }

  private static int getXxx(int num) {

    int result = 0;

    while(num > 0) {
      result += num % 10;
      num /= 10;
    }

    return result;

  }
}	