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
//package codeforces;

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Random;
import java.util.StringTokenizer;

public class C implements Closeable {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter writer = new PrintWriter(System.out);
    StringTokenizer stringTokenizer;

    C() throws IOException {
//        reader = new BufferedReader(new FileReader("input.txt"));
//        writer = new PrintWriter(new FileWriter("bridges.out"));
    }

    String next() throws IOException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            stringTokenizer = new StringTokenizer(reader.readLine());
        }
        return stringTokenizer.nextToken();
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

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

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

    final int MOD = 1000 * 1000 * 1000 + 7;

    int sum(int a, int b) {
        a += b;
        return a >= MOD ? a - MOD : a;
    }

    int product(int a, int b) {
        return (int) (1l * a * b % MOD);
    }

    int pow(int x, int k) {
        int result = 1;
        while (k > 0) {
            if (k % 2 == 1) {
                result = product(result, x);
            }
            x = product(x, x);
            k /= 2;
        }
        return result;
    }

    int pow(int x, long k) {
        int result = 1;
        while (k > 0) {
            if (k % 2 == 1) {
                result = product(result, x);
            }
            x = product(x, x);
            k /= 2;
        }
        return result;
    }

    int inv(int x) {
        return pow(x, MOD - 2);
    }

    void solve() throws IOException {
        List<Long> lucky = new ArrayList<>(1 << 10);
        int[] digits = {4, 7};
        for(int len = 1; len <= 9; len++) {
            for(int mask = 0; mask < 1 << len; mask++) {
                int x = 0;
                for(int i = 0; i < len; i++) {
                    x *= 10;
                    x += digits[(mask >> i) % 2];
                }
                lucky.add(1l * x);
            }
        }
        lucky.add(0L);
        lucky.add(4444444444L);
        Collections.sort(lucky);
        class Utils {
            long intersection(long l1, long r1, long l2, long r2) {
                long l = Math.max(l1, l2);
                long r = Math.min(r1, r2);
                return Math.max(0, r - l + 1);
            }
        }
        Utils utils = new Utils();
        int l = nextInt(), r = nextInt();
        long answer = 0;
        for(int i = 1; i < lucky.size(); i++) {
            answer += lucky.get(i) * utils.intersection(lucky.get(i - 1) + 1, lucky.get(i), l, r);
        }
        writer.println(answer);
    }

    void test() {
        final int n = 3;
        long[] a = new long[n];
        Random random = new Random();
        for(int i = 0; i < n; i++) {
            a[i] = random.nextInt(n) + 1;
        }
        long[] b = Arrays.copyOf(a, n);
        int x = random.nextInt(n);
        solve(n, x, a);
        for (long l : a) {
            if(l < 0) {
                writer.print("test: ");
                for (long i : b) {
                    writer.print(i + " ");
                }
                writer.println("x = " + x);
            }
            return;
        }
    }

    void batchTest() {
        for (int i = 0; i < 100; i++) {
            test();
        }
    }

    private void solve(int n, int x, long[] a) {
        int min = x;
        for(int i = 0; i < n; i++) {
            final int j = (x - i + n) % n;
            if(a[j] < a[min]) {
                min = j;
            }
        }
        long sum = 1l * a[min] * n;
        long subtract = a[min];
        for(int i = 0; i < n; i++) {
            a[i] -= subtract;
        }
        if(a[min] == a[x]) {
            min = x;
        }
        if(x != min) {
            for (int i = (min + 1) % n; ; i = (i + 1) % n) {
                sum++;
                a[i]--;
                if (i == x) break;
            }
        }
        a[min] = sum;
    }

    public static void main(String[] args) throws IOException {
        try (C c = new C()) {
            c.solve();
//            c.batchTest();
        }
    }

    @Override
    public void close() throws IOException {
        reader.close();
        writer.close();
    }
}
