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