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.*;
import java.util.*;
import java.math.*;
import java.lang.*;


public class Main {

    static long arr[]=new long[2050];
    static int c=0;
    public static void main(String[] args) {
        // TODO code application logic here

        try
        {
            Parserdoubt pd=new Parserdoubt(System.in);
            PrintWriter pw=new PrintWriter(System.out);
            //BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            generate(0);
            //System.out.println(c);
            Arrays.sort(arr);
            long s=pd.nextInt();
            long e=pd.nextInt();
            long val=s;
            BigInteger ans=BigInteger.ZERO;
            
            while(val<=e)
            {
                
                int i=0;
                while(val>arr[i])
                {
                    i++;
                }
                
                
                BigInteger a1=BigInteger.valueOf(Math.min(e,arr[i])-val+1);
                BigInteger a2=BigInteger.valueOf(arr[i]);
                ans=ans.add(a1.multiply(a2));
                val=Math.min(e+1,arr[i]+1);
                //System.out.println(arr[i]+" "+val+" "+ans);
            
            }
            pw.println(ans);
            pw.flush();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }

    }
    public static void generate(long n)
    {
        if(n>=10000000000L)return;
        if(n>0)
        arr[c++]=n;
       
        generate(n*10+4);
        generate(n*10+7);
    }

}


class Parserdoubt
    {
       final private int BUFFER_SIZE = 1 << 17;

       private DataInputStream din;
       private byte[] buffer;
       private int bufferPointer, bytesRead;

       public Parserdoubt(InputStream in)
       {
          din = new DataInputStream(in);
          buffer = new byte[BUFFER_SIZE];
          bufferPointer = bytesRead = 0;
       }
       public String nextString() throws Exception
       {
           StringBuffer sb=new StringBuffer("");
           byte c = read();
           while (c <= ' ') c = read();
           do
           {
               sb.append((char)c);
               c=read();
           }while(c>' ');
           return sb.toString();
       }
       public char nextChar() throws Exception
       {
           byte c=read();
           while(c<=' ') c= read();
           return (char)c;
       }
       public int nextInt() throws Exception
       {
          int ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       public long nextLong() throws Exception
       {
          long ret = 0;
          byte c = read();
          while (c <= ' ') c = read();
          boolean neg = c == '-';
          if (neg) c = read();
          do
          {
              ret = ret * 10 + c - '0';
             c = read();
          } while (c > ' ');
          if (neg) return -ret;
          return ret;
       }
       private void fillBuffer() throws Exception
       {
          bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
          if (bytesRead == -1) buffer[0] = -1;
       }

       private byte read() throws Exception
       {
          if (bufferPointer == bytesRead) fillBuffer();
          return buffer[bufferPointer++];
       }
    }