#include <bits/stdc++.h>
using namespace std;
const int MN = 100005;
int A[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int x, y;
  cin >> x >> y;
  int ans = 0;
  for (int i = (x); i < (y + 1); ++i) {
    int t = i;
    while (t) {
      ans += A[t % 10];
      t /= 10;
    }
  }
  printf("%d\n", ans);
  return 0;
}
