Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Let next(x) be the minimum lucky number which is larger than or equals x. Petya is interested what is the value of the expression next(l) + next(l + 1) + ... + next(r - 1) + next(r). Help him solve this problem.

Input

The single line contains two integers l and r (1 ≤ l ≤ r ≤ 109) — the left and right interval limits.

Output

In the single line print the only number — the sum next(l) + next(l + 1) + ... + next(r - 1) + next(r).

Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.

Examples

Input

2 7


Output

33


Input

7 7


Output

7

Note

In the first sample: next(2) + next(3) + next(4) + next(5) + next(6) + next(7) = 4 + 4 + 4 + 7 + 7 + 7 = 33

In the second sample: next(7) = 7

import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;

public class Solution {
//    ----------------------------------------------------------------------------

    public static void main(String[] args) throws IOException {

        //IF INPUT-OUTPUT is via files. uncomment use the below 3 lines of code. comment out the next 4
        //     File file = new File("input.txt"); // here input.txt and output.txt being the file names 
        //   InputReader in = new InputReader(new FileInputStream(file));
        //    PrintWriter out = new PrintWriter(new FileOutputStream("output.txt"));
        //ELSE 
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            ArrayList<Integer> l = new ArrayList<>();
            l.add(4);
            l.add(7);
//            0 2 6 14 30 
            int index = 0;
            for (int i = 2; i < 10; i++) {
                int a = (int) Math.pow(2, i);
                int a0 = (int) Math.pow(2, i - 1);
                for (int j = 0; j < a / 2; j++) {

                    int x = 4 * (int) Math.pow(10, i - 1) + l.get(index + j);

                    l.add(x);

                }

                for (int j = 0; j < a / 2; j++) {

                    int x = 7 * (int) Math.pow(10, i - 1) + l.get(index + j);

                    l.add(x);

                }

                index = index + a0;
            }

            long x = in.nextLong();
            long y = in.nextLong();
            int start = 0;
            int k = 0;
            while (true) {
                if (x == 777777777) {
                    start = l.size() - 1;
                    break;

                }

                if (x > 777777777) {
                    start = l.size();
                    break;
                }
                if (l.get(k) < x) {

                    k++;
                } else {

                    start = k;
                    break;
                }

            }

            int ind = 0;
            BigInteger sum = BigInteger.ZERO;
            for (long i = x; i <= y;) {

                if (start >= l.size()) {

                    BigInteger h = new BigInteger("" + (y - i + 1));
                    BigInteger bigg = new BigInteger("4444444444");
                    sum = sum.add(h.multiply(bigg));
                    //  System.out.println("sum = " + sum);
                    break;
                }

                if (start < l.size()) {
                    // System.out.println("hefdsdsdgdsg");
                    BigInteger an = new BigInteger("" + l.get(start));
//                    BigInteger mul = (an - i + 1)
                    BigInteger ii = new BigInteger("" + i);

                    if (l.get(start) > y) {
                        BigInteger mul = new BigInteger("" + (y - i + 1));
                        sum = sum.add(mul.multiply(an));
                        //  System.out.println(an + " = an , ii = " + ii + " mul = " + mul);
                    } else {
                        BigInteger mul = an.subtract(ii).add(BigInteger.ONE);
                        sum = sum.add(mul.multiply(an));
                        // System.out.println(an + " = an , ii = " + ii + " mul = " + mul);

                    }

                    //sum = sum.add(mul.multiply(an));
                    //System.out.println("sum = " + sum);
                    i = l.get(start) + 1;
                    start++;
                }

            }
            System.out.println(sum);

        }

    }

//    ----------------------------------------------------------------------------
    // MAIN - INPUT - OUTPUT 
    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public Double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int[] nextIntArray(int arraySize) {
            int array[] = new int[arraySize];

            for (int i = 0; i < arraySize; i++) {
                array[i] = nextInt();
            }

            return array;
        }
//need to review this again
//        public char[][] nextMatrix(int row, int col) {
//
//            char[][] m = new char[row][col];
//            
//            return m;
//        }

    }
}
