import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    static void solve(Scanner sc) {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    static void solve(Scanner sc) {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    } main {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    } try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        } {
            solve(sc);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) solve(sc) solve sc String[] args args static void solve(Scanner sc) {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    } solve {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        } {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        } char[] tmp = String.valueOf(i).toCharArray(); tmp String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i int sum = 0; sum 0 for (char c : tmp) {
                sum += c - '0';
            } char c tmp {
                sum += c - '0';
            } {
                sum += c - '0';
            } sum += c - '0' sum c - '0' c '0' if (a <= sum && sum <= b) {
                ans += i;
            } a <= sum && sum <= b a <= sum a sum sum <= b sum b {
                ans += i;
            } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans Scanner sc sc public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    static void solve(Scanner sc) {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    static void solve(Scanner sc) {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    static void solve(Scanner sc) {
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            char[] tmp = String.valueOf(i).toCharArray();
            int sum = 0;
            for (char c : tmp) {
                sum += c - '0';
            }

            if (a <= sum && sum <= b) {
                ans += i;
            }
        }
        System.out.println(ans);
    }
}