#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int func(int x) {
  int sum = 0, temp;
  while (x != 0) {
    temp = x % 10;
    x /= 10;
    sum += mp[temp];
  }
  return sum;
}
int main() {
  int a, b;
  cin >> a >> b;
  mp[0] = 6;
  mp[1] = 2;
  mp[2] = 5;
  mp[3] = 5;
  mp[4] = 4;
  mp[5] = 5;
  mp[6] = 6;
  mp[7] = 3;
  mp[8] = 7;
  mp[9] = 6;
  int sum = 0;
  for (int i = a; i <= b; i++) {
    sum += func(i);
  }
  cout << sum << "\n";
  return 0;
}
