import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    }

    public static int sumOfDigits(int n) {
        int sum = 0;
        while (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) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    }

    public static int sumOfDigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    } Scanner in = new Scanner(System.in); 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 total = 0; total 0 for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        } int i = 1; int i = 1; i 1 i < n + 1 i n + 1 n 1 i++ i++ i {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        } {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        } int sum = sumOfDigits(i); sum sumOfDigits(i) sumOfDigits i if (a <= sum && sum <= b) {
                total += i;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                total += i;
            } total += i total i System.out.println(total) System.out.println System.out System System.out total String[] args args public static int sumOfDigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } sumOfDigits {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } int sum = 0; sum 0 while (n > 0) {
            sum += n % 10;
            n /= 10;
        } n > 0 n 0 {
            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) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    }

    public static int sumOfDigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    }

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

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();


        int total = 0;

        for (int i = 1; i < n + 1; i++) {
            int sum = sumOfDigits(i);
            if (a <= sum && sum <= b) {
                total += i;
            }
        }
        System.out.println(total);
    }

    public static int sumOfDigits(int n) {
        int sum = 0;
        while (n > 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
}
