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