import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        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 = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int sum = 0; sum 0 for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i < N + 1 i N + 1 N 1 i++ i++ i {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        } {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        } String[] val = String.valueOf(i).split(""); val String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" int tmp = 0; tmp 0 for (String c : val) {
                tmp += Integer.parseInt(c);
            } String c val {
                tmp += Integer.parseInt(c);
            } {
                tmp += Integer.parseInt(c);
            } tmp += Integer.parseInt(c) tmp Integer.parseInt(c) Integer.parseInt Integer c if (A <= tmp && tmp <= B) {
                sum += i;
            } A <= tmp && tmp <= B A <= tmp A tmp tmp <= B tmp B {
                sum += i;
            } sum += i sum i 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 = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        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 = Integer.parseInt(sc.next());
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());

        int sum = 0;
        for (int i = 1; i < N + 1; i++) {
            String[] val = String.valueOf(i).split("");

            int tmp = 0;
            for (String c : val) {
                tmp += Integer.parseInt(c);
            }

            if (A <= tmp && tmp <= B) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
}
