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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && digit_sum <= B) {
                sum += i;
            }
        } int i = 0; int i = 0; i 0 i <= N i N i++ i++ i {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && digit_sum <= B) {
                sum += i;
            }
        } {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && digit_sum <= B) {
                sum += i;
            }
        } int digit_sum = 0; digit_sum 0 int n = i; n i while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            } n>0 n 0 {
                digit_sum += n % 10;
                n /= 10;
            } digit_sum += n % 10 digit_sum n % 10 n 10 n /= 10 n 10 if (A <= digit_sum && digit_sum <= B) {
                sum += i;
            } A <= digit_sum && digit_sum <= B A <= digit_sum A digit_sum 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && 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++) {
            int digit_sum = 0;
            int n = i;
            while (n>0) {
                digit_sum += n % 10;
                n /= 10;
            }
            if (A <= digit_sum && digit_sum <= B) {
                sum += i;
            }
        }

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