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