#include <bits/stdc++.h>
using namespace std;
int mas[10000] = {0};
int sz = 0;
void func(int n, int dep = 0) {
  if (dep == 10) return;
  mas[sz++] = n;
  n *= 10;
  n += 4;
  func(n, dep + 1);
  n += 3;
  func(n, dep + 1);
}
int main() {
  int last = 0;
  func(0);
  mas[sz++] = 1000000001;
  sort(mas, mas + sz);
  int l, r;
  long long p;
  scanf("%d%d", &l, &r);
  long long ans = 0;
  int i = lower_bound(mas, mas + sz, l) - mas;
  int j = lower_bound(mas, mas + sz, r) - mas;
  if (i == j) {
    ans = 1ll * mas[i] * (r - l + 1);
    if (i == sz - 1) ans = 1ll * 4444444444 * (r - l + 1);
    cout << ans << endl;
    return 0;
  }
  ans += 1ll * mas[i] * (mas[i] - l + 1);
  last = mas[i];
  ++i;
  for (; i < j; ++i) {
    p = 1ll * mas[i] * (mas[i] - last);
    ans += p;
    last = mas[i];
  }
  if (j != sz - 1)
    ans += 1ll * mas[j] * (r - last);
  else
    ans += 1ll * 4444444444 * (r - 777777777);
  cout << ans << endl;
  return 0;
}
