import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String N = sc.next(); N sc.next() sc.next sc int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int sum; sum int SUM = 0; SUM 0 for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        } Integer i = 0; Integer i = 0; i 0 i < Integer.parseInt(N) + 1 i Integer.parseInt(N) + 1 Integer.parseInt(N) Integer.parseInt Integer N 1 i++ i++ i {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        } {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        } sum = 0 sum 0 for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            } Integer j = 0; Integer j = 0; j 0 j < i.toString().length() j i.toString().length() i.toString().length i.toString() i.toString i j++ j++ j {
                sum += Integer.parseInt(i.toString().split("")[j]);
            } {
                sum += Integer.parseInt(i.toString().split("")[j]);
            } sum += Integer.parseInt(i.toString().split("")[j]) sum Integer.parseInt(i.toString().split("")[j]) Integer.parseInt Integer i.toString().split("")[j] i.toString().split("") i.toString().split i.toString() i.toString i "" j if (sum >= A && sum <= B)
                SUM += i; sum >= A && sum <= B sum >= A sum A sum <= B sum B SUM += i SUM i PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(SUM) out.println out SUM sc.close() sc.close sc out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    }
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int A = Integer.parseInt(sc.next());
        int B = Integer.parseInt(sc.next());
        int sum;
        int SUM = 0;

        for (Integer i = 0; i < Integer.parseInt(N) + 1; i++) {
            sum = 0;
            for (Integer j = 0; j < i.toString().length(); j++) {
                sum += Integer.parseInt(i.toString().split("")[j]);
            }
            if (sum >= A && sum <= B)
                SUM += i;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(SUM);

        sc.close();
        out.flush();
    }
}
