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