import java.io.*;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    }
}
 import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) Task solver = new Task(); solver new Task() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    } Task public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        } solve {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        } int N = Integer.parseInt(in.next()); N Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int A = Integer.parseInt(in.next()); A Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int B = Integer.parseInt(in.next()); B Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in int sum = 0; sum 0 for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            } {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            } int n = i; n i int digSum = 0; digSum 0 while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                } n > 0 n 0 {
                    digSum += n % 10;
                    n /= 10;
                } digSum += n % 10 digSum n % 10 n 10 n /= 10 n 10 if (digSum >= A && digSum <= B)
                    sum += i; digSum >= A && digSum <= B digSum >= A digSum A digSum <= B digSum B sum += i sum i out.println(sum) out.println out sum int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    }
} Main
import java.io.*;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = Integer.parseInt(in.next());
            int A = Integer.parseInt(in.next());
            int B = Integer.parseInt(in.next());

            int sum = 0;
            for (int i = 1; i <= N; i++) {
                int n = i;
                int digSum = 0;
                while (n > 0) {
                    digSum += n % 10;
                    n /= 10;
                }
                if (digSum >= A && digSum <= B)
                    sum += i;
            }
            out.println(sum);
        }

    }
}

