#include <bits/stdc++.h>
using namespace std;
int nsegs[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int a, b;
  cin >> a >> b;
  int ntot = 0;
  for (int j = a; j <= b; j++) {
    if (j == 0)
      ntot += 6;
    else {
      int k = j;
      while (k > 0) {
        ntot += nsegs[k % 10];
        k /= 10;
      }
    }
  }
  cout << ntot << endl;
  return 0;
}
