#include <bits/stdc++.h>
using namespace std;
int a[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int scr(int i) {
  int s = 0;
  while (i) {
    s += a[i % 10];
    i /= 10;
  }
  return s;
}
int main() {
  long long k = 0;
  int a, b;
  cin >> a >> b;
  for (int i = a; i <= b; i++) k += scr(i);
  cout << k << endl;
  return 0;
}
