#include <bits/stdc++.h>
using namespace std;
long long next(long long a) {
  long long res = a;
  long long kol = 0;
  while (res % 10 == 7) {
    kol++;
    res /= 10;
  }
  if (res == 0) {
    res = 4;
    for (long i = 0; i < kol; i++) res = res * 10 + 4;
  } else {
    res /= 10;
    res = res * 10 + 7;
    for (long i = 0; i < kol; i++) res = res * 10 + 4;
  }
  return res;
}
int main() {
  long long l, r;
  cin >> l >> r;
  vector<long long> good;
  good.reserve(100000);
  good.push_back(4);
  long beg = 0;
  while (good[good.size() - 1] < r) {
    good.push_back(next(good[good.size() - 1]));
    if (good[good.size() - 1] >= l && good[good.size() - 2] < l)
      beg = good.size() - 1;
  }
  long long res = 0;
  while (l <= r) {
    res += (min(good[beg], r) - l + 1) * good[beg];
    l = good[beg] + 1;
    beg++;
  }
  vector<long> ress;
  while (res != 0) {
    ress.push_back(res % 10);
    res /= 10;
  }
  for (long i = ress.size() - 1; i >= 0; i--) cout << ress[i];
}
