import java.util.Scanner;

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

        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());

        int sum = 0;
        for (int i = 1; i < n + 1; i++) {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        }
        System.out.println(sum);

    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());

        int sum = 0;
        for (int i = 1; i < n + 1; i++) {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        }
        System.out.println(sum);

    }
} Main public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());

        int sum = 0;
        for (int i = 1; i < n + 1; i++) {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        }
        System.out.println(sum);

    } main {

        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());

        int sum = 0;
        for (int i = 1; i < n + 1; i++) {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        }
        System.out.println(sum);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.parseInt(scan.next()); n Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int a = Integer.parseInt(scan.next()); a Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int b = Integer.parseInt(scan.next()); b Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int sum = 0; sum 0 for (int i = 1; i < n + 1; i++) {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        } int i = 1; int i = 1; i 1 i < n + 1 i n + 1 n 1 i++ i++ i {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        } {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        } int c = 0; c 0 int j = i; j i while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            } true {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            } if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                } j / 10 != 0 j / 10 j 10 0 {
                    c += j % 10;
                    j = j / 10;
                } c += j % 10 c j % 10 j 10 j = j / 10 j j / 10 j 10 {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                } c += j % 10 c j % 10 j 10 if (c >= a && c <= b) {
                        sum += i;
                    } c >= a && c <= b c >= a c a c <= b c b {
                        sum += i;
                    } sum += i sum i break; System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.Scanner;

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

        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());

        int sum = 0;
        for (int i = 1; i < n + 1; i++) {
            int c = 0;
            int j = i;
            while (true) {
                if (j / 10 != 0) {
                    c += j % 10;
                    j = j / 10;
                } else {
                    c += j % 10;
                    if (c >= a && c <= b) {
                        sum += i;
                    }
                    break;
                }
            }
        }
        System.out.println(sum);

    }
}