#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int inf = 1 << 30;
int main() {
  int seg[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int a, b;
  while (~scanf("%d %d", &a, &b)) {
    long long all = 0;
    for (int i = a; i <= b; ++i) {
      int k = i, ans = 0;
      while (k) {
        ans += seg[k % 10];
        k /= 10;
      }
      all += ans;
    }
    printf("%I64d\n", all);
  }
  return 0;
}
