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.util.ArrayList;
import java.util.Collections;

/**
 * Created by IntelliJ IDEA.
 * User: piyushd
 * Date: 3/26/11
 * Time: 10:53 PM
 * To change this template use File | Settings | File Templates.
 */
public class TaskA {

    final long LIM = 123456789123L;
    ArrayList<Long> lucky;

    void generate(long x) {
        if(x < LIM) lucky.add(x);
        else return;

        generate(x * 10 + 4);
        generate(x * 10 + 7);
    }

    void run() {
        this.lucky = new ArrayList<Long>();
        generate(4);
        generate(7);
        Collections.sort(lucky);

        long[] l = new long[lucky.size()];
        int ix = 0;
        for(long x : lucky) {
            l[ix++] = x;
        }

        int L = nextInt(), R = nextInt();

        int l1 = 0, r1 = lucky.size();
        if(L > l[l1]) {
            while(r1 - l1 > 1) {
                int m1 = l1 + (r1 - l1) / 2;
                if(l[m1] >=  L) r1 = m1;
                else l1 = m1;
            }
        }
        else {
            r1 = 0;
        }

        int l2 = 0, r2 = lucky.size();
        if(R > l[l2]) {
            while(r2 - l2 > 1) {
                int m2 = l2 + (r2 - l2) / 2;
                if (l[m2] >= R) r2 = m2;
                else l2 = m2;
            }
        }
        else {
            r2 = 0;
        }

        long ans = l[r1] * (long)(l[r1] - L + 1);
        for(int i = r1 + 1; i <= r2; i++) {
            ans += l[i] * (long) (l[i] - l[i - 1]);
        }
        ans -= l[r2] * (long) (l[r2] - R);
        System.out.println(ans);
    }

    int nextInt() {
        try {
            int c = System.in.read();
            if (c == -1) return c;
            while (c != '-' && (c < '0' || '9' < c)) {
                c = System.in.read();
                if (c == -1) return c;
            }
            if (c == '-') return -nextInt();
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = System.in.read();
            } while ('0' <= c && c <= '9');
            return res;
        } catch (Exception e) {
            return -1;
        }
    }

    long nextLong() {
        try {
            int c = System.in.read();
            if (c == -1) return -1;
            while (c != '-' && (c < '0' || '9' < c)) {
                c = System.in.read();
                if (c == -1) return -1;
            }
            if (c == '-') return -nextLong();
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = System.in.read();
            } while ('0' <= c && c <= '9');
            return res;
        } catch (Exception e) {
            return -1;
        }
    }

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

    String next() {
        try {
            StringBuilder res = new StringBuilder("");
            int c = System.in.read();
            while (Character.isWhitespace(c))
                c = System.in.read();
            do {
                res.append((char) c);
            } while (!Character.isWhitespace(c = System.in.read()));
            return res.toString();
        } catch (Exception e) {
            return null;
        }
    }

    String nextLine() {
        try {
            StringBuilder res = new StringBuilder("");
            int c = System.in.read();
            while (c == '\r' || c == '\n')
                c = System.in.read();
            do {
                res.append((char) c);
                c = System.in.read();
            } while (c != '\r' && c != '\n');
            return res.toString();
        } catch (Exception e) {
            return null;
        }
    }

    public static void main(String[] args) {
        new TaskA().run();
    }
}
