#include <bits/stdc++.h>
using namespace std;
int arahbar[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int arahkol[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int kudabar[8] = {-2, -1, 1, 2, 2, 1, -1, -2};
int kudakol[8] = {1, 2, 2, 1, -1, -2, -2, -1};
inline int mutlak(int x) {
  if (x > 0) return x;
  return -x;
}
inline long long mutlak(long long x) {
  if (x > 0) return x;
  return -x;
}
int jum[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int x, y;
  cin >> x >> y;
  long long ans = 0;
  for (int i = (int)x; i <= (int)y; i++) {
    int k = i;
    while (k) {
      ans += (long long)jum[k % 10];
      k /= 10;
    }
  }
  cout << ans << endl;
  return 0;
}
