#include <bits/stdc++.h>
int a, b, i, j;
long long s;
int v[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  scanf("%d%d", &a, &b);
  for (i = a; i <= b; i++) {
    j = i;
    while (j) {
      s += v[j % 10];
      j /= 10;
    }
  }
  printf("%I64d", s);
  return 0;
}
