#include <bits/stdc++.h>
using namespace std;
int a[1000000 + 10];
long long sum[1000000 + 10];
int work(int x) {
  int sum = 0;
  while (x) {
    int tmp = x % 10;
    sum += a[tmp];
    x /= 10;
  }
  return sum;
}
int aa, b;
int main() {
  a[0] = 6;
  a[1] = 2;
  a[2] = 5;
  a[3] = 5;
  a[4] = 4;
  a[5] = 5;
  a[6] = 6;
  a[7] = 3;
  a[8] = 7;
  a[9] = 6;
  sum[0] = a[0];
  for (int i = 1; i <= 1000000; ++i) {
    if (i >= 10) {
      a[i] = work(i);
    }
    sum[i] = sum[i - 1] + a[i];
  }
  while (~scanf("%d %d", &aa, &b)) {
    printf("%I64d\n", sum[b] - sum[aa - 1]);
  }
  return 0;
}
