#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, i, total = 0, temp;
  int arr[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  cin >> x >> y;
  for (i = x; i <= y; i++) {
    temp = x;
    while (temp > 0) {
      total += arr[temp % 10];
      temp /= 10;
    }
    x++;
  }
  cout << total << endl;
  return 0;
}
