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