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.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeSet;



public class Main {
	
	/**
	 * @param args
	 */
	 BufferedReader in;
	    PrintWriter out = new PrintWriter(System.out);
	    StringTokenizer tok;
	   
	     String readToken() throws IOException { // reads the token; to read a full line use in.readLine()
	    while (tok == null || !tok.hasMoreTokens()) {
	    tok = new StringTokenizer(in.readLine());
	    	
	    }
	    return tok.nextToken(); // sometimes it's better to use nextToken(String) method here
	    }
	     int readInt() throws IOException { // write readDouble(), readLong(), readBigInteger() methods if necessary
	    return Integer.parseInt(readToken());
	    }
	     public String readLine() throws IOException{
			return in.readLine();
	    	 
	     }
	     long readLong() throws IOException { // write readDouble(), readLong(), readBigInteger() methods if necessary
	    	    return Long.parseLong(readToken());
	    	    }
	     double readDouble() throws IOException { // write readDouble(), readLong(), readBigInteger() methods if necessary
	    	    return Double.parseDouble(readToken());
	    	    }
	    public static void main(String[] args) throws IOException
	    {
	       new Main().run();
	    }
	    void run() throws IOException
	    {
	    	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	    	out = new PrintWriter(new OutputStreamWriter(System.out));
	    	in = new BufferedReader(new InputStreamReader(System.in));
	    	if (oj){
	    
	    	}
	    	else{
	    		
	    		
	    	}
	       solve();
	       out.flush();
	       tok=null;
	    }
	  
	    long[] A=new long[3000];
	    int ceil(int high, int low, int x)
	    {
	      int i;   
	     
	      if(x <= A[low])
	        return low; 
	     
	     
	      for(i = low; i < high; i++)
	      {
	        if(A[i] == x)
	          return i;
	 
	        if(A[i] < x && A[i+1] >= x)
	           return i+1;
	      }        
	     

	      return -1;
	    }
	     
	    void solve() throws IOException{
	    	/*
	    	 * briskw ola ta lucky numbers apo to 4 mexti to 10^10 (kapou ekei :P)
	    	 * efarmozw binary search briskw ta next apo ta dio akra
	    	 * kai arxizw na prosthetw 
	    	 */
	    	int l=readInt();
	    	int r=readInt();
	    	long ans=0;
	    	
	    	
	    	 A[0]=4;
	    	 A[1]=7;
	    	 int bc=0;
	    	 int lc=1;
	    	 long pow=1;
	    	 for (int i=1;i<=9;++i){
	    		 pow=pow*10;
	    		long  p1=4*pow;
	    		 long p2=7*pow;
	    		 int  nbc=lc+1;
	    		 int nlc=nbc;
	    		 for (int z=bc;z<=lc;++z){
	    			 
	    			 A[nlc]=p1+A[z];
	    			
	    			 nlc++;
	    		 }
	    		 for (int z=bc;z<=lc;++z){
	    			 A[nlc]= p2+A[z];
	    			 nlc++;
	    		 }
	    		 bc=nbc;
	    		 lc=nlc-1;
	    	 }
	    	 int o1=ceil(1022,0,l);
	    	 int o2=ceil(1022,0,r);
	    	 
	    	 if (o1==o2){
	    		ans=A[o1]*(1+r-l); 
	    	 }else{
	    	 ans=(A[o1]+1-l)*A[o1];
	    	 for (int i=o1+1;i<o2;++i){
	    		
	    		 long ta=(A[i]-A[i-1])*A[i];
	    		 ans+=ta;
	    	 }
	    	
	    	 
	    	 long t=(r-A[o2-1])*A[o2];
	    	 ans+=t;
	    	 }
	    	 out.println(ans);
	    }
}