import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    static int digitSum(long n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} import java.util.*; util.* java public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    static int digitSum(long n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[]$) {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    } main {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    } int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int sum = 0; sum 0 for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        } {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        } int j = digitSum(i); j digitSum(i) digitSum i if (a <= j && j <= b) {
                sum += i;
            } a <= j && j <= b a <= j a j j <= b j b {
                sum += i;
            } sum += i sum i System.out.println(sum) System.out.println System.out System System.out sum String[]$ $ static int digitSum(long n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    } digitSum {
        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 long n n public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    static int digitSum(long n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    static int digitSum(long n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
} Main
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int j = digitSum(i);
            if (a <= j && j <= b) {
                sum += i;
            }
        }
        System.out.println(sum);
    }

    static int digitSum(long n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }
}