import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Set; Set java.util import java.util.TreeSet; TreeSet java.util class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
} Main public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    } main {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    } try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } IOException | NumberFormatException e {
            e.printStackTrace();
            System.exit(0);
        } e.printStackTrace() e.printStackTrace e System.exit(0) System.exit System 0 catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        } final Exception e {
            e.printStackTrace();
            System.exit(0);
        } e.printStackTrace() e.printStackTrace e System.exit(0) System.exit System 0 {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) List<String> inputNumberString = Arrays.asList(br.readLine().split(" ")); inputNumberString Arrays.asList(br.readLine().split(" ")) Arrays.asList Arrays br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int N = Integer.parseInt(inputNumberString.get(0)); N Integer.parseInt(inputNumberString.get(0)) Integer.parseInt Integer inputNumberString.get(0) inputNumberString.get inputNumberString 0 int A = Integer.parseInt(inputNumberString.get(1)); A Integer.parseInt(inputNumberString.get(1)) Integer.parseInt Integer inputNumberString.get(1) inputNumberString.get inputNumberString 1 int B = Integer.parseInt(inputNumberString.get(2)); B Integer.parseInt(inputNumberString.get(2)) Integer.parseInt Integer inputNumberString.get(2) inputNumberString.get inputNumberString 2 int ans = 0; ans 0 for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            } {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            } List<String> tmpStringList = Arrays.asList(String.valueOf(i).split("")); tmpStringList Arrays.asList(String.valueOf(i).split("")) Arrays.asList Arrays String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" int tmpSum = 0; tmpSum 0 for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                } String str tmpStringList {
                    tmpSum += Integer.parseInt(str);
                } {
                    tmpSum += Integer.parseInt(str);
                } tmpSum += Integer.parseInt(str) tmpSum Integer.parseInt(str) Integer.parseInt Integer str if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                } tmpSum >= A && tmpSum <= B tmpSum >= A tmpSum A tmpSum <= B tmpSum B {
                    ans += i;
                } ans += i ans i System.out.println(ans) System.out.println System.out System System.out ans final String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int N = Integer.parseInt(inputNumberString.get(0));
            int A = Integer.parseInt(inputNumberString.get(1));
            int B = Integer.parseInt(inputNumberString.get(2));

            int ans = 0;
            for (int i = 1; i <= N; i++) {
                List<String> tmpStringList = Arrays.asList(String.valueOf(i).split(""));
                int tmpSum = 0;
                for (String str : tmpStringList) {
                    tmpSum += Integer.parseInt(str);
                }

                if (tmpSum >= A && tmpSum <= B) {
                    ans += i;
                }
            }

            System.out.println(ans);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}