import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        int ans = 0;

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        for (int i = 1; i <= n; i++) {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        }

        System.out.println(ans);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        int ans = 0;

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        for (int i = 1; i <= n; i++) {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        }

        System.out.println(ans);
        sc.close();
    }
} Main public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        int ans = 0;

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        for (int i = 1; i <= n; i++) {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        }

        System.out.println(ans);
        sc.close();
    } main {

        Scanner sc = new Scanner(System.in);

        int ans = 0;

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        for (int i = 1; i <= n; i++) {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        }

        System.out.println(ans);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans = 0; ans 0 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 for (int i = 1; i <= n; i++) {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        } {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        } int x = 0; x 0 int d = i; d i while (d > 0) {
                x += d % 10;
                d /= 10;
            } d > 0 d 0 {
                x += d % 10;
                d /= 10;
            } x += d % 10 x d % 10 d 10 d /= 10 d 10 if (a <= x && x <= b)
                ans += i; a <= x && x <= b a <= x a x x <= b x b ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);

        int ans = 0;

        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        for (int i = 1; i <= n; i++) {
            int x = 0;
            int d = i;
            while (d > 0) {
                x += d % 10;
                d /= 10;
            }
            if (a <= x && x <= b)
                ans += i;
        }

        System.out.println(ans);
        sc.close();
    }
}
