#include <bits/stdc++.h>
using namespace std;
int main() {
  unordered_map<int, int> mp;
  int n1, n2, k, sum = 0;
  for (int i = 0; i <= 9; i++) mp[i] = 0;
  cin >> n1 >> n2;
  if (n1 == 0) {
    sum += 6;
    n1++;
  }
  while (n1 <= n2) {
    k = n1;
    while (k > 0) {
      mp[k % 10]++;
      k = k / 10;
    }
    n1++;
  }
  sum += 6 * (mp[0] + mp[6] + mp[9]);
  sum += 2 * (mp[1]);
  sum += 5 * (mp[2] + mp[3] + mp[5]);
  sum += 4 * mp[4];
  sum += 3 * mp[7];
  sum += 7 * mp[8];
  cout << sum << endl;
  return 0;
}
