import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class Main
{
    private static InputStream debugInput() {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    }

    private static InputStream stdin() {
        return System.in;
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   }
} import java.io.ByteArrayInputStream; ByteArrayInputStream java.io import java.io.InputStream; InputStream java.io import java.util.Scanner; Scanner java.util public class Main
{
    private static InputStream debugInput() {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    }

    private static InputStream stdin() {
        return System.in;
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   }
} Main private static InputStream debugInput() {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    } debugInput {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    } String s = "20 2 5"; s "20 2 5" return new ByteArrayInputStream(s.getBytes()); new ByteArrayInputStream(s.getBytes()) private static InputStream stdin() {
        return System.in;
    } stdin {
        return System.in;
    } return System.in; System.in System System.in public static void main(String[] args)
    {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   } main {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   } Scanner sc = new Scanner(stdin()); sc new Scanner(stdin()) 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 total = 0; total 0 for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        } {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        } int x = i; x i int sum = 0; sum 0 while (x > 0) {
                sum += (x % 10);
                x /= 10;
            } x > 0 x 0 {
                sum += (x % 10);
                x /= 10;
            } sum += (x % 10) sum (x % 10) x 10 x /= 10 x 10 if (sum >= a && sum <= b) {

                total += i;
            } sum >= a && sum <= b sum >= a sum a sum <= b sum b {

                total += i;
            } total += i total i System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main
{
    private static InputStream debugInput() {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    }

    private static InputStream stdin() {
        return System.in;
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   }
} public class Main
{
    private static InputStream debugInput() {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    }

    private static InputStream stdin() {
        return System.in;
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   }
} Main
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class Main
{
    private static InputStream debugInput() {
        String s = "20 2 5";
        return new ByteArrayInputStream(s.getBytes());
    }

    private static InputStream stdin() {
        return System.in;
    }

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(stdin());
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int total = 0;
        for (int i = 1; i <= n; i++) {
            int x = i;
            int sum = 0;
            while (x > 0) {
                sum += (x % 10);
                x /= 10;
            }

            if (sum >= a && sum <= b) {

                total += i;
            }
        }

        System.out.println(total);
   }
}
