#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int di[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int r = 0;
  for (int i = a; i <= b; i++) {
    int x = i;
    while (x > 0) {
      r += di[x % 10];
      x /= 10;
    }
  }
  cout << r << endl;
}
