#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long llinf = 1e18 + 7;
const double eps = 1e-15;
int main() {
  int s[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int a, b;
  long long ans = 0;
  cin >> a >> b;
  for (int i = (a), step = ((a) <= (b)) ? 1 : -1, __temp = b + step;
       i != __temp; i += step) {
    int x = i;
    while (x) ans += s[x % 10], x /= 10;
  }
  printf("%lld", ans);
  return 0;
}
