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

@SuppressWarnings("unchecked")
public class P122C {

  final static long [] HAPPY_NUMBERS = 
    { 4L, 7L,
      44L, 47L, 74L, 77L,
      444L, 447L, 474L, 477L, 744L, 747L, 774L, 777L,
      4444L, 4447L, 4474L, 4477L, 4744L, 4747L, 4774L, 4777L, 7444L, 7447L, 7474L, 7477L, 7744L, 7747L, 7774L, 7777L,
      44444L, 44447L, 44474L, 44477L, 44744L, 44747L, 44774L, 44777L, 47444L, 47447L, 47474L, 47477L, 47744L, 47747L,
      47774L, 47777L, 74444L, 74447L, 74474L, 74477L, 74744L, 74747L, 74774L, 74777L, 77444L, 77447L, 77474L, 77477L,
      77744L, 77747L, 77774L, 77777L,
      444444L, 444447L, 444474L, 444477L, 444744L, 444747L, 444774L, 444777L, 447444L, 447447L, 447474L, 447477L, 447744L,
      447747L, 447774L, 447777L, 474444L, 474447L, 474474L, 474477L, 474744L, 474747L, 474774L, 474777L, 477444L, 477447L,
      477474L, 477477L, 477744L, 477747L, 477774L, 477777L, 744444L, 744447L, 744474L, 744477L, 744744L, 744747L, 744774L,
      744777L, 747444L, 747447L, 747474L, 747477L, 747744L, 747747L, 747774L, 747777L, 774444L, 774447L, 774474L, 774477L,
      774744L, 774747L, 774774L, 774777L, 777444L, 777447L, 777474L, 777477L, 777744L, 777747L, 777774L, 777777L,
      4444444L, 4444447L, 4444474L, 4444477L, 4444744L, 4444747L, 4444774L, 4444777L, 4447444L, 4447447L, 4447474L, 4447477L,
      4447744L, 4447747L, 4447774L, 4447777L, 4474444L, 4474447L, 4474474L, 4474477L, 4474744L, 4474747L, 4474774L, 4474777L,
      4477444L, 4477447L, 4477474L, 4477477L, 4477744L, 4477747L, 4477774L, 4477777L, 4744444L, 4744447L, 4744474L, 4744477L,
      4744744L, 4744747L, 4744774L, 4744777L, 4747444L, 4747447L, 4747474L, 4747477L, 4747744L, 4747747L, 4747774L, 4747777L,
      4774444L, 4774447L, 4774474L, 4774477L, 4774744L, 4774747L, 4774774L, 4774777L, 4777444L, 4777447L, 4777474L, 4777477L,
      4777744L, 4777747L, 4777774L, 4777777L, 7444444L, 7444447L, 7444474L, 7444477L, 7444744L, 7444747L, 7444774L, 7444777L,
      7447444L, 7447447L, 7447474L, 7447477L, 7447744L, 7447747L, 7447774L, 7447777L, 7474444L, 7474447L, 7474474L, 7474477L,
      7474744L, 7474747L, 7474774L, 7474777L, 7477444L, 7477447L, 7477474L, 7477477L, 7477744L, 7477747L, 7477774L, 7477777L,
      7744444L, 7744447L, 7744474L, 7744477L, 7744744L, 7744747L, 7744774L, 7744777L, 7747444L, 7747447L, 7747474L, 7747477L,
      7747744L, 7747747L, 7747774L, 7747777L, 7774444L, 7774447L, 7774474L, 7774477L, 7774744L, 7774747L, 7774774L, 7774777L,
      7777444L, 7777447L, 7777474L, 7777477L, 7777744L, 7777747L, 7777774L, 7777777L,
      44444444L, 44444447L, 44444474L, 44444477L, 44444744L, 44444747L, 44444774L, 44444777L, 44447444L, 44447447L, 44447474L,
      44447477L, 44447744L, 44447747L, 44447774L, 44447777L, 44474444L, 44474447L, 44474474L, 44474477L, 44474744L, 44474747L,
      44474774L, 44474777L, 44477444L, 44477447L, 44477474L, 44477477L, 44477744L, 44477747L, 44477774L, 44477777L, 44744444L,
      44744447L, 44744474L, 44744477L, 44744744L, 44744747L, 44744774L, 44744777L, 44747444L, 44747447L, 44747474L, 44747477L,
      44747744L, 44747747L, 44747774L, 44747777L, 44774444L, 44774447L, 44774474L, 44774477L, 44774744L, 44774747L, 44774774L,
      44774777L, 44777444L, 44777447L, 44777474L, 44777477L, 44777744L, 44777747L, 44777774L, 44777777L, 47444444L, 47444447L,
      47444474L, 47444477L, 47444744L, 47444747L, 47444774L, 47444777L, 47447444L, 47447447L, 47447474L, 47447477L, 47447744L,
      47447747L, 47447774L, 47447777L, 47474444L, 47474447L, 47474474L, 47474477L, 47474744L, 47474747L, 47474774L, 47474777L,
      47477444L, 47477447L, 47477474L, 47477477L, 47477744L, 47477747L, 47477774L, 47477777L, 47744444L, 47744447L, 47744474L,
      47744477L, 47744744L, 47744747L, 47744774L, 47744777L, 47747444L, 47747447L, 47747474L, 47747477L, 47747744L, 47747747L,
      47747774L, 47747777L, 47774444L, 47774447L, 47774474L, 47774477L, 47774744L, 47774747L, 47774774L, 47774777L, 47777444L,
      47777447L, 47777474L, 47777477L, 47777744L, 47777747L, 47777774L, 47777777L, 74444444L, 74444447L, 74444474L, 74444477L,
      74444744L, 74444747L, 74444774L, 74444777L, 74447444L, 74447447L, 74447474L, 74447477L, 74447744L, 74447747L, 74447774L,
      74447777L, 74474444L, 74474447L, 74474474L, 74474477L, 74474744L, 74474747L, 74474774L, 74474777L, 74477444L, 74477447L,
      74477474L, 74477477L, 74477744L, 74477747L, 74477774L, 74477777L, 74744444L, 74744447L, 74744474L, 74744477L, 74744744L,
      74744747L, 74744774L, 74744777L, 74747444L, 74747447L, 74747474L, 74747477L, 74747744L, 74747747L, 74747774L, 74747777L,
      74774444L, 74774447L, 74774474L, 74774477L, 74774744L, 74774747L, 74774774L, 74774777L, 74777444L, 74777447L, 74777474L,
      74777477L, 74777744L, 74777747L, 74777774L, 74777777L, 77444444L, 77444447L, 77444474L, 77444477L, 77444744L, 77444747L,
      77444774L, 77444777L, 77447444L, 77447447L, 77447474L, 77447477L, 77447744L, 77447747L, 77447774L, 77447777L, 77474444L,
      77474447L, 77474474L, 77474477L, 77474744L, 77474747L, 77474774L, 77474777L, 77477444L, 77477447L, 77477474L, 77477477L,
      77477744L, 77477747L, 77477774L, 77477777L, 77744444L, 77744447L, 77744474L, 77744477L, 77744744L, 77744747L, 77744774L,
      77744777L, 77747444L, 77747447L, 77747474L, 77747477L, 77747744L, 77747747L, 77747774L, 77747777L, 77774444L, 77774447L,
      77774474L, 77774477L, 77774744L, 77774747L, 77774774L, 77774777L, 77777444L, 77777447L, 77777474L, 77777477L, 77777744L,
      77777747L, 77777774L, 77777777L,
      444444444L, 444444447L, 444444474L, 444444477L, 444444744L, 444444747L, 444444774L, 444444777L, 444447444L, 444447447L,
      444447474L, 444447477L, 444447744L, 444447747L, 444447774L, 444447777L, 444474444L, 444474447L, 444474474L, 444474477L,
      444474744L, 444474747L, 444474774L, 444474777L, 444477444L, 444477447L, 444477474L, 444477477L, 444477744L, 444477747L,
      444477774L, 444477777L, 444744444L, 444744447L, 444744474L, 444744477L, 444744744L, 444744747L, 444744774L, 444744777L,
      444747444L, 444747447L, 444747474L, 444747477L, 444747744L, 444747747L, 444747774L, 444747777L, 444774444L, 444774447L,
      444774474L, 444774477L, 444774744L, 444774747L, 444774774L, 444774777L, 444777444L, 444777447L, 444777474L, 444777477L,
      444777744L, 444777747L, 444777774L, 444777777L, 447444444L, 447444447L, 447444474L, 447444477L, 447444744L, 447444747L,
      447444774L, 447444777L, 447447444L, 447447447L, 447447474L, 447447477L, 447447744L, 447447747L, 447447774L, 447447777L,
      447474444L, 447474447L, 447474474L, 447474477L, 447474744L, 447474747L, 447474774L, 447474777L, 447477444L, 447477447L, 
      447477474L, 447477477L, 447477744L, 447477747L, 447477774L, 447477777L, 447744444L, 447744447L, 447744474L, 447744477L,
      447744744L, 447744747L, 447744774L, 447744777L, 447747444L, 447747447L, 447747474L, 447747477L, 447747744L, 447747747L,
      447747774L, 447747777L, 447774444L, 447774447L, 447774474L, 447774477L, 447774744L, 447774747L, 447774774L, 447774777L,
      447777444L, 447777447L, 447777474L, 447777477L, 447777744L, 447777747L, 447777774L, 447777777L, 474444444L, 474444447L,
      474444474L, 474444477L, 474444744L, 474444747L, 474444774L, 474444777L, 474447444L, 474447447L, 474447474L, 474447477L,
      474447744L, 474447747L, 474447774L, 474447777L, 474474444L, 474474447L, 474474474L, 474474477L, 474474744L, 474474747L,
      474474774L, 474474777L, 474477444L, 474477447L, 474477474L, 474477477L, 474477744L, 474477747L, 474477774L, 474477777L,
      474744444L, 474744447L, 474744474L, 474744477L, 474744744L, 474744747L, 474744774L, 474744777L, 474747444L, 474747447L,
      474747474L, 474747477L, 474747744L, 474747747L, 474747774L, 474747777L, 474774444L, 474774447L, 474774474L, 474774477L,
      474774744L, 474774747L, 474774774L, 474774777L, 474777444L, 474777447L, 474777474L, 474777477L, 474777744L, 474777747L,
      474777774L, 474777777L, 477444444L, 477444447L, 477444474L, 477444477L, 477444744L, 477444747L, 477444774L, 477444777L,
      477447444L, 477447447L, 477447474L, 477447477L, 477447744L, 477447747L, 477447774L, 477447777L, 477474444L, 477474447L,
      477474474L, 477474477L, 477474744L, 477474747L, 477474774L, 477474777L, 477477444L, 477477447L, 477477474L, 477477477L,
      477477744L, 477477747L, 477477774L, 477477777L, 477744444L, 477744447L, 477744474L, 477744477L, 477744744L, 477744747L,
      477744774L, 477744777L, 477747444L, 477747447L, 477747474L, 477747477L, 477747744L, 477747747L, 477747774L, 477747777L,
      477774444L, 477774447L, 477774474L, 477774477L, 477774744L, 477774747L, 477774774L, 477774777L, 477777444L, 477777447L,
      477777474L, 477777477L, 477777744L, 477777747L, 477777774L, 477777777L, 744444444L, 744444447L, 744444474L, 744444477L,
      744444744L, 744444747L, 744444774L, 744444777L, 744447444L, 744447447L, 744447474L, 744447477L, 744447744L, 744447747L,
      744447774L, 744447777L, 744474444L, 744474447L, 744474474L, 744474477L, 744474744L, 744474747L, 744474774L, 744474777L,
      744477444L, 744477447L, 744477474L, 744477477L, 744477744L, 744477747L, 744477774L, 744477777L, 744744444L, 744744447L,
      744744474L, 744744477L, 744744744L, 744744747L, 744744774L, 744744777L, 744747444L, 744747447L, 744747474L, 744747477L,
      744747744L, 744747747L, 744747774L, 744747777L, 744774444L, 744774447L, 744774474L, 744774477L, 744774744L, 744774747L,
      744774774L, 744774777L, 744777444L, 744777447L, 744777474L, 744777477L, 744777744L, 744777747L, 744777774L, 744777777L,
      747444444L, 747444447L, 747444474L, 747444477L, 747444744L, 747444747L, 747444774L, 747444777L, 747447444L, 747447447L,
      747447474L, 747447477L, 747447744L, 747447747L, 747447774L, 747447777L, 747474444L, 747474447L, 747474474L, 747474477L,
      747474744L, 747474747L, 747474774L, 747474777L, 747477444L, 747477447L, 747477474L, 747477477L, 747477744L, 747477747L,
      747477774L, 747477777L, 747744444L, 747744447L, 747744474L, 747744477L, 747744744L, 747744747L, 747744774L, 747744777L,
      747747444L, 747747447L, 747747474L, 747747477L, 747747744L, 747747747L, 747747774L, 747747777L, 747774444L, 747774447L,
      747774474L, 747774477L, 747774744L, 747774747L, 747774774L, 747774777L, 747777444L, 747777447L, 747777474L, 747777477L,
      747777744L, 747777747L, 747777774L, 747777777L, 774444444L, 774444447L, 774444474L, 774444477L, 774444744L, 774444747L,
      774444774L, 774444777L, 774447444L, 774447447L, 774447474L, 774447477L, 774447744L, 774447747L, 774447774L, 774447777L,
      774474444L, 774474447L, 774474474L, 774474477L, 774474744L, 774474747L, 774474774L, 774474777L, 774477444L, 774477447L,
      774477474L, 774477477L, 774477744L, 774477747L, 774477774L, 774477777L, 774744444L, 774744447L, 774744474L, 774744477L,
      774744744L, 774744747L, 774744774L, 774744777L, 774747444L, 774747447L, 774747474L, 774747477L, 774747744L, 774747747L,
      774747774L, 774747777L, 774774444L, 774774447L, 774774474L, 774774477L, 774774744L, 774774747L, 774774774L, 774774777L,
      774777444L, 774777447L, 774777474L, 774777477L, 774777744L, 774777747L, 774777774L, 774777777L, 777444444L, 777444447L,
      777444474L, 777444477L, 777444744L, 777444747L, 777444774L, 777444777L, 777447444L, 777447447L, 777447474L, 777447477L,
      777447744L, 777447747L, 777447774L, 777447777L, 777474444L, 777474447L, 777474474L, 777474477L, 777474744L, 777474747L,
      777474774L, 777474777L, 777477444L, 777477447L, 777477474L, 777477477L, 777477744L, 777477747L, 777477774L, 777477777L,
      777744444L, 777744447L, 777744474L, 777744477L, 777744744L, 777744747L, 777744774L, 777744777L, 777747444L, 777747447L,
      777747474L, 777747477L, 777747744L, 777747747L, 777747774L, 777747777L, 777774444L, 777774447L, 777774474L, 777774477L,
      777774744L, 777774747L, 777774774L, 777774777L, 777777444L, 777777447L, 777777474L, 777777477L, 777777744L, 777777747L,
      777777774L, 777777777L,
      4444444444L };
 
  public void run() throws Exception {
    long l = nextInt(), r = nextInt();

    int idx = Arrays.binarySearch(HAPPY_NUMBERS, l);
    idx = (idx < 0) ? (-idx - 1) : idx;
    long s = 0;
    while (l <= r) {
      s += HAPPY_NUMBERS[idx] * (Math.min(HAPPY_NUMBERS[idx], r) - l + 1);
      l = Math.min(HAPPY_NUMBERS[idx] , r) + 1;
      idx++;
    }

    println(s);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P122C().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }

  int gcd(int a, int b) {
    return ((b > 0) ? gcd(b, a % b) : a);
  }
}