import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] nab = scanner.nextLine().split(" ", 3);
        int n = Integer.parseInt(nab[0]);
        int a = Integer.parseInt(nab[1]);
        int b = Integer.parseInt(nab[2]);

        int result = 0;
        for (int i = 1; i <= n; i++) {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        }
        System.out.println(result);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] nab = scanner.nextLine().split(" ", 3);
        int n = Integer.parseInt(nab[0]);
        int a = Integer.parseInt(nab[1]);
        int b = Integer.parseInt(nab[2]);

        int result = 0;
        for (int i = 1; i <= n; i++) {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] nab = scanner.nextLine().split(" ", 3);
        int n = Integer.parseInt(nab[0]);
        int a = Integer.parseInt(nab[1]);
        int b = Integer.parseInt(nab[2]);

        int result = 0;
        for (int i = 1; i <= n; i++) {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        }
        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);
        String[] nab = scanner.nextLine().split(" ", 3);
        int n = Integer.parseInt(nab[0]);
        int a = Integer.parseInt(nab[1]);
        int b = Integer.parseInt(nab[2]);

        int result = 0;
        for (int i = 1; i <= n; i++) {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        }
        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] nab = scanner.nextLine().split(" ", 3); nab scanner.nextLine().split(" ", 3) scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " 3 int n = Integer.parseInt(nab[0]); n Integer.parseInt(nab[0]) Integer.parseInt Integer nab[0] nab 0 int a = Integer.parseInt(nab[1]); a Integer.parseInt(nab[1]) Integer.parseInt Integer nab[1] nab 1 int b = Integer.parseInt(nab[2]); b Integer.parseInt(nab[2]) Integer.parseInt Integer nab[2] nab 2 int result = 0; result 0 for (int i = 1; i <= n; i++) {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        } {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        } int total = 0; total 0 int num = i; num i while (num > 0) {
                total += num % 10;
                num /= 10;
            } num > 0 num 0 {
                total += num % 10;
                num /= 10;
            } total += num % 10 total num % 10 num 10 num /= 10 num 10 if (a <= total && total <= b) {
                result += i;
            } a <= total && total <= b a <= total a total total <= b total b {
                result += i;
            } result += i result i System.out.println(result) System.out.println System.out System System.out result String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] nab = scanner.nextLine().split(" ", 3);
        int n = Integer.parseInt(nab[0]);
        int a = Integer.parseInt(nab[1]);
        int b = Integer.parseInt(nab[2]);

        int result = 0;
        for (int i = 1; i <= n; i++) {
            int total = 0;
            int num = i;
            while (num > 0) {
                total += num % 10;
                num /= 10;
            }
            if (a <= total && total <= b) {
                result += i;
            }
        }
        System.out.println(result);
    }
}
