#include <bits/stdc++.h>
using namespace std;
int jml, a, b, i, k;
int pecah(int x) {
  if (x == 0) return 6;
  if (x == 1) return 2;
  if (x == 2) return 5;
  if (x == 3) return 5;
  if (x == 4) return 4;
  if (x == 5) return 5;
  if (x == 6) return 6;
  if (x == 7) return 3;
  if (x == 8) return 7;
  if (x == 9) return 6;
}
void angka(int x) {
  while (x != 0) {
    k = x % 10;
    jml += pecah(k);
    x /= 10;
  }
}
int main() {
  cin >> a >> b;
  jml = 0;
  for (i = a; i <= b; i++) {
    angka(i);
  }
  cout << jml << endl;
}
