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