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