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