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.*;
import java.io.*;
public class C91CC{
    static BufferedReader br;
    public static void main(String args[])throws Exception{
        br=new BufferedReader(new InputStreamReader(System.in));

       long temp[]=toLongArray();
       long l=temp[0];
       long r=temp[1];
       String str=""+r;
       int len=str.length()+1;

       ArrayList<Long> all=new ArrayList();
       all.add(3L);

       long p=10;

       //long time=System.currentTimeMillis();
       while(p<10000000000L){
           long t=3*p;
           int s=all.size();
           for(int i=0;i<s;i++){
                all.add(t+all.get(i));
           }
           all.add(t);
           p*=10;
       }

       ArrayList<Long> a4=new ArrayList();

       int count=0;
       String st="1";
       while(count<len){
           long t=Long.parseLong(st);
           a4.add(t*4);
           st+="1";
           count++;
       }

       ArrayList<Long> mix=new ArrayList();
       for(int i=0;i<a4.size();i++){
           long t=a4.get(i);
           for(int j=0;j<all.size();j++){
               long tt=all.get(j);
               if(t>tt){
                   mix.add(t+tt);
               }
               else break;
           }
       }

       for(int i=0;i<a4.size();i++){
           mix.add(a4.get(i));
       }

       long nm[]=new long[mix.size()];
       for(int i=0;i<nm.length;i++){
           nm[i]=mix.get(i);
       }

       Arrays.sort(nm);
       long res=0;
       int ind=0;
       for(int i=0;i<nm.length;i++){
          if(nm[i]>=l){
             ind=i;
              break;
           }
       }
       int c=0;
       for(int i=ind;i<nm.length;i++){
           res+=(Math.min(nm[i],r)-l+1)*nm[i];
            l=nm[i]+1;
            if(nm[i]>=r){
                break;
            }
       }


       
       prln(res);
       //System.out.println(System.currentTimeMillis()-time);

    }


    /****************************************************************/
    public static int[] toIntArray()throws Exception{
       String str[]=br.readLine().split(" ");
       int k[]=new int[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Integer.parseInt(str[i]);
       }
       return k;
    }
    public static int toInt()throws Exception{
       return Integer.parseInt(br.readLine());
    }
    public static long[] toLongArray()throws Exception{
       String str[]=br.readLine().split(" ");
       long k[]=new long[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Long.parseLong(str[i]);
       }
       return k;
    }
    public static long toLong()throws Exception{
       return Long.parseLong(br.readLine());
    }
    public static double[] toDoubleArray()throws Exception{
       String str[]=br.readLine().split(" ");
       double k[]=new double[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Double.parseDouble(str[i]);
       }
       return k;
    }
    public static double toDouble()throws Exception{
       return Double.parseDouble(br.readLine());
    }
    public static String toStr()throws Exception{
       return br.readLine();
    }
    public static String[] toStrArray()throws Exception{
       String str[]=br.readLine().split(" ");
       return str;
    }
    public static void pr(Object st){
	System.out.print(st);
    }
    public static void prln(Object st){
	System.out.println(st);
    }	 /****************************************************************/

}
