#include <bits/stdc++.h>
using namespace std;
int a[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int make(int x) {
  int c = 0;
  while (x / 10) {
    c += a[x % 10];
    x /= 10;
  }
  if (x != 0) c += a[x % 10];
  return c;
}
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int ans = 0;
  for (int i = a; i <= b; i++) ans += make(i);
  printf("%d\n", ans);
}
