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
# 1) Find next(L)

# 2) if next(L) >= R:
#   (next(L)) * (R-L+1)
#   break
# if R > next(L):
#   get next(L) * (next(L) - L + 1)

# 3) move L to next(L) + 1

# END


def conv_to_bin(num):
    """Convert a number to binary, with
    specified num of bits"""
    # Get the div every time until the number is 1
    bin_num = ""
    while num > 0:
        d, r = divmod(num, 2)
        num = d
        bin_num += str(r)

    # find a way to make the string length (bits)
    # fill the empty spots at the lefet with zero
    return bin_num[::-1]


def find_next(L):
    # bits = [0 for a in str(L)]
    """Finds the next lucky number"""

    # check the number againt binary 1 to 2^n -1
    # # of bits = n
    # where n is the number of digits the number has
    n = len(str(L))
    for num in range(2**n):
        # compare each to L
        # and check if that number is greater than L
        bin_num = conv_to_bin(num).zfill(n)
        bin_num = ['4' if num == '0' else '7' for num in str(bin_num)]
        bin_num = int("".join(bin_num))
        if bin_num >= L:
            return bin_num

    # if none of them are correct
    # then return 4 * num_digits + 1
    return int('4' * (n + 1))


def lucky(num):
    num_set = set(str(num))
    return (len(num_set) == 2 and "7" in num_set and "4" in num_set) or \
        (len(num_set) == 1 and ("7" in num_set or "4" in num_set))


L, R = [int(a) for a in input().strip().split()]

total = 0
while True:
    nxt = find_next(L)
    if nxt >= R:
        res = nxt * (R-L+1)
        total += res
        break
    else:
        res = nxt * (nxt-L+1)
        total += res
    L = nxt + 1

print(total)

# for i in range(100):
#     print(f"{i} ---> {find_next(i)}")
