import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    } main {
        Main main = new Main();
        main.solve();
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan long answer = 0; answer 0 for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        } {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        } String x = Integer.toString(i); x Integer.toString(i) Integer.toString Integer i int t = 0; t 0 for (char c : x.toCharArray()) {
                t += c - '0';
            } char c x.toCharArray() x.toCharArray x {
                t += c - '0';
            } {
                t += c - '0';
            } t += c - '0' t c - '0' c '0' if (A <= t && t <= B) {
                answer += i;
            } A <= t && t <= B A <= t A t t <= B t B {
                answer += i;
            } answer += i answer i System.out.println(answer) System.out.println System.out System System.out answer public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = 1; i <= N; i++) {
            String x = Integer.toString(i);
            int t = 0;
            for (char c : x.toCharArray()) {
                t += c - '0';
            }
            if (A <= t && t <= B) {
                answer += i;
            }
        }
        System.out.println(answer);
    }
}
