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