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 str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        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 sum = 0;
        for (int i = 0; i <= N; i++) {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        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 sum = 0;
        for (int i = 0; i <= N; i++) {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        sc.close();
    } 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 str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        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 sum = 0; sum 0 for (int i = 0; i <= N; i++) {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        } int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        } {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i String[] array = str.split(""); array str.split("") str.split str "" int digit_sum = 0; digit_sum 0 for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            } int j = 0; int j = 0; j 0 j < array.length j array.length array array.length j++ j++ j {
                digit_sum += Integer.parseInt(array[j]);
            } {
                digit_sum += Integer.parseInt(array[j]);
            } digit_sum += Integer.parseInt(array[j]) digit_sum Integer.parseInt(array[j]) Integer.parseInt Integer array[j] array j if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            } digit_sum >= A && digit_sum <= B digit_sum >= A digit_sum A digit_sum <= B digit_sum B {
                sum += i;
            } sum += i sum i System.out.printf("%d\n", sum) System.out.printf System.out System System.out "%d\n" sum 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 sum = 0;
        for (int i = 0; i <= N; i++) {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        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 sum = 0;
        for (int i = 0; i <= N; i++) {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        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 sum = 0;
        for (int i = 0; i <= N; i++) {
            String str = String.valueOf(i);
            String[] array = str.split("");
            int digit_sum = 0;
            for (int j = 0; j < array.length; j++) {
                digit_sum += Integer.parseInt(array[j]);
            }
            if (digit_sum >= A && digit_sum <= B) {
                sum += i;
            }
        }

        System.out.printf("%d\n", sum);
        sc.close();
    }
}