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 javax.sound.sampled.Line;
import java.awt.Point;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.io.*;
import java.math.BigInteger;
import static java.math.BigInteger.*;
import java.util.*;
public class A{

    ArrayList<Long>all;

    void solve()throws Exception
    {
        long l=nextInt();
        long r=nextInt();
        all=new ArrayList<Long>();
        get(0,(long)7777777777L);
        Collections.sort(all);
        long res=solve((int)r)-solve((int)l-1);
        System.out.println(res);

    }
    long solve(int r)
    {
        int[]dp=new int[all.size()];
        for(int i=0;i<dp.length;i++)
        {
            long x=all.get(i);
            int low=0;
            int high=r+1;
            while (high-low>1)
            {
                int mid=(low+high)/2;
                if(x>=mid)
                    low=mid;
                else
                    high=mid;
            }
            dp[i]=low+1;
        }
        long res=0;
        for(int i=0;i<dp.length;i++)
        {
            res+=dp[i]*all.get(i);
            if(i>0)
                res-=dp[i-1]*all.get(i);
        }
        return res;

    }
    void get(long cur,long max)
    {
        if(cur>max)
            return;
        if(cur!=0)
            all.add(cur);
        get(10*cur+4,max);
        get(10*cur+7,max);

    }


     ////////////
    BufferedReader reader;
    PrintWriter writer;
    StringTokenizer stk;
    void run()throws Exception
    {
        reader=new BufferedReader(new InputStreamReader(System.in));
        stk=null;
        writer=new PrintWriter(new PrintWriter(System.out));
        solve();
        reader.close();
        writer.close();
    }
    int nextInt()throws Exception
    {
        return Integer.parseInt(nextToken());
    }

    long nextLong()throws Exception
    {
        return Long.parseLong(nextToken());

    }
    double nextDouble()throws Exception
    {
        return Double.parseDouble(nextToken());


    }

    String nextString()throws Exception
    {
        return nextToken();
    }
    String nextLine()throws Exception
    {
        return reader.readLine();
    }
    String nextToken()throws Exception
    {
        if(stk==null || !stk.hasMoreTokens())
        {
            stk=new StringTokenizer(nextLine());
            return nextToken();

        }
        return stk.nextToken();
    }

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



}