#include <bits/stdc++.h>
using namespace std;
vector<int> getDigits(int n) {
  vector<int> v;
  while (n) {
    v.push_back(n % 10);
    n /= 10;
  }
  return v;
}
int main() {
  int segs[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int a, b;
  cin >> a >> b;
  int cnt = 0;
  for (; a <= b; a++) {
    vector<int> ds = getDigits(a);
    for (int i = 0; i < ds.size(); i++) cnt += segs[ds[i]];
  }
  cout << cnt << endl;
  return 0;
}
