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;
const long double pi = acos(-1.0);
vector<long long> v1, v2;
long long ans = 0, x, y;
long long fact[1008], dp[1008][1008];
void pow1(long long a[], long long i, long long end, long long sum) {
  if (i == end) {
    v1.push_back(sum);
    return;
  }
  pow1(a, i + 1, end, sum + a[i]);
  pow1(a, i + 1, end, sum);
}
void subsetSums1(long long arr[], long long l, long long r, long long sum = 0) {
  if (l > r) {
    v1.push_back(sum);
    return;
  }
  subsetSums1(arr, l + 1, r, sum + arr[l]);
  subsetSums1(arr, l + 1, r, sum);
}
void subsetSums2(long long arr[], long long l, long long r, long long sum = 0) {
  if (l > r) {
    v2.push_back(sum);
    return;
  }
  subsetSums2(arr, l + 1, r, sum + arr[l]);
  subsetSums2(arr, l + 1, r, sum);
}
void pow2(long long a[], long long i, long long end, long long sum) {
  if (i == end) {
    v2.push_back(sum);
    return;
  }
  pow1(a, i + 1, end, sum + a[i]);
  pow1(a, i + 1, end, sum);
}
string bn(long long length) {
  string s;
  s.resize(length);
  char a[length];
  for (int i = 0; i < length; ++i) a[i] = '0';
  for (int i = 0; i < length; ++i) s[i] = a[i];
  cout << s;
  return s;
  int count = length - 1;
  while (length) {
    s[count--] = (length % 2);
    length /= 2;
  }
  return s;
}
long long powm(long long a, long long b, long long m) {
  if (b == 0) return 1;
  long long t = powm(a, b / 2, m);
  if (b % 2) return a * t % m * t % m;
  return t * t % m;
}
long long modinv1(long long b, long long m) { return powm(b, m - 2, m); }
long long nck(long long n, long long k) {
  return fact[n] * modinv1(fact[n - k], 1000000007) % 1000000007 *
         modinv1(fact[k], 1000000007) % 1000000007;
}
int suffix(int l, vector<int> v) {
  int ans = 0;
  long long p = 1;
  for (int i = 0; i < max((int)v.size(), l); ++i) {
    if (i < v.size()) {
      ans = (ans + p * v[i] % 998244353) % 998244353;
      p = (p * 10) % 998244353;
    }
    if (i < l) {
      p = (p * 10) % 998244353;
    }
  }
  return ans;
}
int prefix(vector<int> v, int l) {
  int ans = 0;
  long long p = 1;
  for (int i = 0; i < max((int)v.size(), l); ++i) {
    if (i < l) {
      p = (p * 10) % 998244353;
    }
    if (i < v.size()) {
      ans = (ans + p * v[i] % 998244353) % 998244353;
      p = (p * 10) % 998244353;
    }
  }
  return ans;
}
int ct = 0;
void sum(long long n) {
  if (n / 10 == 0) return;
  long long ans = 0;
  while (n) {
    ans += n % 10;
    n /= 10;
  }
  ct++;
  sum(ans);
}
vector<long long> v;
long long string_num(string);
void perm(long long l, long long cur, long long n) {
  if (cur == l) {
    v.push_back(n);
    return;
  }
  perm(l, cur + 1, n * 10 + 4);
  perm(l, cur + 1, n * 10 + 7);
}
long long string_num(string s) {
  int x = s.size();
  long long ans = 0, i = 0;
  while (x--) {
    ans += (pow(10, x) * (s[i++] - '0'));
  }
  return ans;
}
void DJ() {
  long long l, r;
  cin >> l >> r;
  long long ans = 0;
  for (int i = 1; i < 11; ++i) {
    perm(i, 0, 0);
  }
  long long it = lower_bound(v.begin(), v.end(), l) - v.begin();
  long long sum = r - l + 1;
  if (v[it] - l >= sum) {
    ans += sum * v[it];
    sum = 0;
  } else {
    ans += v[it] * (v[it] - l + 1);
    sum -= v[it] - l + 1;
    it++;
  }
  while (sum) {
    if (v[it] - v[it - 1] >= sum) {
      ans += sum * (v[it]);
      sum = 0;
    } else {
      ans += v[it] * (v[it] - v[it - 1]);
      sum -= v[it] - v[it - 1];
      it++;
    }
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) DJ();
  return 0;
}
