#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int a, b, i, j;
  cin >> a >> b;
  int count = 0;
  for (i = a; i <= b; i++) {
    j = i;
    while (1) {
      if (j == 0) break;
      count += arr[j % 10];
      j /= 10;
    }
  }
  cout << count << endl;
}
