#include <bits/stdc++.h>
using namespace std;
int a[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long int hit[1000002];
void solve() {
  long long int s, i, x;
  for (i = 0; i < 1000001; i++) {
    s = 0;
    x = i;
    while (x) {
      s += a[x % 10];
      x /= 10;
    }
    hit[i] = s;
  }
  return;
}
int main() {
  solve();
  long long int i, x, y, sum = 0;
  scanf("%I64d %I64d", &x, &y);
  for (i = x; i <= y; i++) sum += hit[i];
  printf("%I64d", sum);
  return 0;
}
