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 sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    }

} 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 sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    }

} 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 sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    } 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 sum = 0; sum 0 for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        } {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        } String[] digit = String.valueOf(i + 1).split(""); digit String.valueOf(i + 1).split("") String.valueOf(i + 1).split String.valueOf(i + 1) String.valueOf String i + 1 i 1 "" int digitSum = 0; digitSum 0 for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            } int j = 0; int j = 0; j 0 j < digit.length j digit.length digit digit.length j++ j++ j {
                digitSum += Integer.parseInt(digit[j]);
            } {
                digitSum += Integer.parseInt(digit[j]);
            } digitSum += Integer.parseInt(digit[j]) digitSum Integer.parseInt(digit[j]) Integer.parseInt Integer digit[j] digit j if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            } digitSum >= a && digitSum <= b digitSum >= a digitSum a digitSum <= b digitSum b {
                sum += i + 1;
            } sum += i + 1 sum i + 1 i 1 System.out.println(sum) System.out.println System.out System System.out sum 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 sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    }

} 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 sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    }

} 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 sum = 0;
        for (int i = 0; i < n; i++) {
            String[] digit = String.valueOf(i + 1).split("");
            int digitSum = 0;
            for (int j = 0; j < digit.length; j++) {
                digitSum += Integer.parseInt(digit[j]);
            }
            if (digitSum >= a && digitSum <= b) {
                sum += i + 1;
            }
        }
        System.out.println(sum);
    }

}
