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 Main03{ 
  public static int index;
  public static ArrayList<Long> list;
  public static void main(String[] args)throws Exception {
    InputReader in = new InputReader(System.in);
    PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
    
    list = new ArrayList<Long>();
    rec(0);
    Collections.sort(list);
    // pw.println(list.size());
    // pw.println(list.get(BS(478)));
    
    long l = in.nextLong(), r = in.nextLong(), sum = 0;
    
    for(long i = l; i <= r; ){
      int idx = BS(i); //System.err.println(i+" "+ list.get(idx));
      
      long min = Math.min(list.get(idx), r);
      long temp = min - i + 1;
      sum += temp*list.get(idx);
      i = list.get(idx)+1; //System.err.println(temp+" "+i+" "+sum);
    }
    
    pw.println(sum);
    pw.close();
  }
  
  static int BS(long num){
    int lo  = 0, hi = list.size(), mid = (lo+hi)/2;
    long temp = 0;
    while(lo < hi){
      mid = (lo+hi)/2;
      temp = list.get(mid);
      if( temp >= num) hi = mid;
      else lo = mid+1;
    }
    return lo; //returns the lowest index where arr[lo] >= num;
  }
  
  static void rec(long n){
    if(n < (long)1e10 && n > 0) list.add(n);
    if(n > (long)1e10) return;
    
    rec(n*10l+4l);
    rec(n*10+7);
  }
    
  
  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;
    
    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream));
      tokenizer = null;
    }
    
    public String next()throws Exception {
      while (tokenizer == null || !tokenizer.hasMoreTokens())
        tokenizer = new StringTokenizer(reader.readLine());
      return tokenizer.nextToken();
    }
    
    public String nextLine()throws Exception {
      String line = null;
      tokenizer = null;
      line =  reader.readLine();
      return line;
    }
    
    public int nextInt()throws Exception {
      return Integer.parseInt(next());
    }
    
    public double nextDouble() throws Exception{
      return Double.parseDouble(next());
    }
    
    public long nextLong()throws Exception {
      return Long.parseLong(next());
    }
    
  }
}
   		 	  	   	 		   		  	 			