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