#include <bits/stdc++.h>
long long int segments[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}, segmentsSum = 49;
int a, b;
long long int getSegments(int n) {
  long long int r = 0;
  while (n) {
    r += segments[n % 10];
    n /= 10;
  }
  return r;
}
long long int getBetween(int a, int b) {
  long long int r, temp;
  r = 0;
  temp = a >= 10 ? getSegments(a / 10) : 0;
  while (a < b && a % 10 > 0) {
    r += temp + segments[a++ % 10];
  }
  temp = b >= 10 ? getSegments(b / 10) : 0;
  while (a < b && b % 10 < 9) {
    r += temp + segments[b-- % 10];
  }
  if (a == b) return r + getSegments(a);
  return getBetween(a / 10, b / 10) * 10 + (b / 10 - a / 10 + 1) * segmentsSum +
         r;
}
int main() {
  scanf("%d %d", &a, &b);
  printf("%lld", getBetween(a, b));
  return 0;
}
