#include <bits/stdc++.h>
using namespace std;
const int MN = 100000 + 1;
int d[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int tedad(int x) {
  if (x == 0) return 0;
  return d[x % 10] + tedad(x / 10);
}
int counter;
int main() {
  int n, m;
  cin >> n >> m;
  if (n == 0) {
    counter = 5;
    n++;
  }
  for (int i = n; i <= m; i++) counter += tedad(i);
  cout << counter << endl;
  return 0;
}
