import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC083BSomeSums {
        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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        }

        private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return sum;
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.io.PrintStream; PrintStream java.io 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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC083BSomeSums {
        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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        }

        private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return 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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        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) ABC083BSomeSums solver = new ABC083BSomeSums(); solver new ABC083BSomeSums() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class ABC083BSomeSums {
        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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        }

        private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return sum;
        }

    } ABC083BSomeSums 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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        } solve {
            int n = Integer.parseInt(in.next());
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        } 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 ans = 0; ans 0 for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            } {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            } int sum = someDigits(i); sum someDigits(i) someDigits i if (sum >= a && sum <= b) {
                    ans += i;
                } sum >= a && sum <= b sum >= a sum a sum <= b sum b {
                    ans += i;
                } ans += i ans i System.out.println(String.valueOf(ans)) System.out.println System.out System System.out String.valueOf(ans) String.valueOf String ans int testNumber testNumber Scanner in in PrintWriter out out private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return sum;
        } someDigits {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return sum;
        } int sum = 0; sum 0 while (i > 0) {
                sum += i % 10;
                i /= 10;
            } i > 0 i 0 {
                sum += i % 10;
                i /= 10;
            } sum += i % 10 sum i % 10 i 10 i /= 10 i 10 return sum; sum int i i 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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC083BSomeSums {
        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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        }

        private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return 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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC083BSomeSums {
        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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        }

        private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return sum;
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        ABC083BSomeSums solver = new ABC083BSomeSums();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC083BSomeSums {
        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 ans = 0;

            for (int i = 1; i <= n; i++) {
                int sum = someDigits(i);
                if (sum >= a && sum <= b) {
                    ans += i;
                }
            }
            System.out.println(String.valueOf(ans));
        }

        private int someDigits(int i) {
            int sum = 0;
            while (i > 0) {
                sum += i % 10;
                i /= 10;
            }
            return sum;
        }

    }
}

