#include <bits/stdc++.h>
using namespace std;
long long calculate(int i) {
  int arr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  long long sum = 0;
  while (i > 0) {
    sum += (long long)arr[i % 10];
    i /= 10;
  }
  return sum;
}
int main() {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  long long sum = 0;
  for (int i = a; i <= b; i++) sum += calculate(i);
  cout << sum << endl;
}
