#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, temp, rem, sum = 0;
  int mp[11];
  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;
  cin >> a >> b;
  for (int i = a; i <= b; i++) {
    temp = i;
    while (temp) {
      rem = temp % 10;
      sum += mp[rem];
      temp /= 10;
    }
  }
  cout << sum << endl;
  return 0;
}
