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.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.InputMismatchException;

/**
 * @author thesparkboy
 *
 */
public class LuckySum {

	static ArrayList<Long> a = new ArrayList<>();
	static long max = (int) 1e11;

	static void pre(long x) {
		if (x > max) {
			return;
		}
		long x1 = x * 10 + 7;
		long x2 = x * 10 + 4;
		a.add(x1);
		a.add(x2);
		pre(x1);
		pre(x2);
	}

	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		long l = in.readInt();
		long r = in.readInt();
		a.add((long) 4);
		a.add((long) 7);
		pre(4);
		pre(7);

		Collections.sort(a);
		// System.out.println(a);

		long ans = 0;
		int idx1 = Collections.binarySearch(a, l);
		int idx2 = Collections.binarySearch(a, r);
		if (idx1 == idx2) {
			if (idx1 < 0) {
				idx1 = Math.abs(idx1 + 1);
			}
			System.out.println(a.get(idx1) * (r - l + 1));
			out.close();
			return;
		}
		if (idx1 < 0) {
			idx1 = Math.abs(idx1 + 1);
			ans += a.get(idx1) * (a.get(idx1) - l + 1);
			l = a.get(idx1) + 1;
		}
		if (idx2 < 0) {
			idx2 = Math.abs(idx2 + 1);
			ans += a.get(idx2) * (r - a.get(idx2 - 1));
			r = a.get(idx2 - 1);
		}
		while (l <= r) {
			ans += a.get(idx1) * (a.get(idx1) - l + 1);
			l = a.get(idx1) + 1;
			idx1 = Collections.binarySearch(a, l);
			if (idx1 < 0)
				idx1 = Math.abs(idx1 + 1);
		}
		System.out.println(ans);
		out.close();
	}

	private static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public long readLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			long sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int readInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuffer res = new StringBuffer();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		static boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next() {
			return readString();
		}
	}

	private static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(outputStream);
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}
	}
}