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>
#pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("Ofast")
using namespace std;
const long double pi = acos(-1);
const long long int M = 1e9 + 9, N = 1e7 + 5, INF = 1e10;
long long int gcd(long long int a, long long int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x % M;
  while (y > 0) {
    if (y & 1) res = (res * x) % M;
    y = y >> 1;
    x = (x * x) % M;
  }
  return res;
}
long long int modInverse(long long int n) { return power(n, M - 2); }
long long int nCr(int n, int r) {
  if (r == 0) return 1;
  int fac[n + 1];
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = ((fac[i - 1] % M) * (i % M)) % M;
  return (fac[n] * modInverse(fac[r]) % M * modInverse(fac[n - r]) % M) % M;
}
vector<long long int> ln{0};
void luck(long long int n) {
  if (n > 1e10) return;
  ln.push_back(n * 10 + 4);
  ln.push_back(n * 10 + 7);
  luck(n * 10 + 4);
  luck(n * 10 + 7);
}
long long int next(long long int l, long long int r, long long int x) {
  long long int mid;
  if (r >= l) {
    mid = (l + r) / 2;
    if (ln[mid] >= x && ln[mid - 1] < x) return ln[mid];
    if (ln[mid] > x)
      return next(l, mid - 1, x);
    else
      return next(mid + 1, r, x);
  }
}
long long int solve(long long int l, long long int r) {
  if (l > r) {
    return 0;
  }
  long long int sum = 0, n;
  n = next(0, (long long int)(ln).size() - 1, l);
  sum = (min(n, r) - l + 1) * n + solve(n + 1, r);
  return sum;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  luck(0);
  sort(ln.begin(), ln.end());
  long long int l, r;
  cin >> l >> r;
  cout << solve(l, r) << "\n";
  return 0;
}
