import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    }

    private static int sum(int n) {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    }

    private static int sum(int n) {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        } {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int A = in.nextInt(); A in.nextInt() in.nextInt in int B = in.nextInt(); B in.nextInt() in.nextInt in int sum2 = 0; sum2 0 for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            } {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            } int sum = sum(i); sum sum(i) sum i if (sum >= A && sum <= B) {
                    sum2 += i;
                } sum >= A && sum <= B sum >= A sum A sum <= B sum B {
                    sum2 += i;
                } sum2 += i sum2 i System.out.println(sum2) System.out.println System.out System System.out sum2 String[] args args private static int sum(int n) {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } sum {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } int sum = 0; sum 0 for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        } ; n > 0 n 0 {
            sum += n % 10;
            n /= 10;
        } {
            sum += n % 10;
            n /= 10;
        } sum += n % 10 sum n % 10 n 10 n /= 10 n 10 return sum; sum int n n public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    }

    private static int sum(int n) {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    }

    private static int sum(int n) {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            int sum2 = 0;
            for (int i = 1; i <= N; i++) {
                int sum = sum(i);
                if (sum >= A && sum <= B) {
                    sum2 += i;
                }
            }

            System.out.println(sum2);
        }
    }

    private static int sum(int n) {
        int sum = 0;
        for (; n > 0;) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
}
