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
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long int dx[] = {-1, 1, -1, 0, 0, -1, 1, 1};
long long int dy[] = {-1, -1, 1, -1, 1, 0, 0, 1};
long long int gcd(long long int a, long long int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int modular_expo(long long int x, long long int y, long long int m) {
  long long int ans = 1;
  while (y) {
    if (y & 1) ans = (ans % m * x % m) % m;
    x = (x % m * x % m) % m;
    y /= 2;
  }
  return ans % m;
}
long long int power(long long int x, long long int y) {
  long long int ans = 1;
  while (y) {
    if (y & 1) ans = (ans * x);
    x *= x;
    y /= 2;
  }
  return ans;
}
void solve() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long int primeFactors(long long int n) {
  long long int cnt = 1;
  while (n % 2 == 0) {
    printf("%d ", 2);
    cnt++;
    n = n / 2;
  }
  for (long long int i = 3; i <= sqrt(n); i += 2) {
    while (n % i == 0) {
      cnt++;
      printf("%d ", i);
      n = n / i;
    }
  }
  if (n > 2) cnt++;
  return cnt;
}
long long int check(long long int n) {
  long long int l = 1, h = n, res = h;
  while (l <= h) {
    long long int mid = (l + h) / 2;
    long long int total = ((mid) * (mid + 1)) / 2;
    if (total >= n) {
      res = mid;
      h = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return res;
}
vector<long long int> lucky;
long long int l, r;
void backtracking(long long int x) {
  if (x > 1e10) return;
  lucky.emplace_back(x);
  backtracking(10 * x + 4);
  backtracking(10 * x + 7);
}
long long int solve(long long int x) {
  if (x == 0) return 0LL;
  long long int res = 0;
  long long int last = 0;
  for (auto a : lucky) {
    long long int r = min(a, x);
    res += (r - last) * a;
    last = r;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  long long int sum = 0;
  cin >> l >> r;
  backtracking(4);
  backtracking(7);
  sort(lucky.begin(), lucky.end());
  long long int ans = solve(r) - solve(l - 1);
  cout << ans << "\n";
  return 0;
}
