import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int min = Integer.parseInt(sc.next()); min Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int max = Integer.parseInt(sc.next()); max Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        } {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        } char[] array = Integer.toString(i).toCharArray(); array Integer.toString(i).toCharArray() Integer.toString(i).toCharArray Integer.toString(i) Integer.toString Integer i int sum = 0; sum 0 for (char c : array) {
                sum += Character.getNumericValue(c);
            } char c array {
                sum += Character.getNumericValue(c);
            } {
                sum += Character.getNumericValue(c);
            } sum += Character.getNumericValue(c) sum Character.getNumericValue(c) Character.getNumericValue Character c if (sum >= min && sum <= max) {
                ans += i;
            } sum >= min && sum <= max sum >= min sum min sum <= max sum max {
                ans += i;
            } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int min = Integer.parseInt(sc.next());
        int max = Integer.parseInt(sc.next());
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] array = Integer.toString(i).toCharArray();
            int sum = 0;
            for (char c : array) {
                sum += Character.getNumericValue(c);
            }
            if (sum >= min && sum <= max) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
}
