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