#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long a[1000069] = {0};
int main() {
  long long x, y, i, j, tmp, ct = 0, ans = 0;
  scanf("%lld", &x);
  ;
  scanf("%lld", &y);
  ;
  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;
  if (y >= 10) {
    for (i = 10; i < y + 1; i++) {
      tmp = i;
      while (tmp != 0) {
        ct += a[tmp % 10];
        tmp = tmp / 10;
      }
      a[i] = ct;
      ct = 0;
    }
  }
  for (i = x; i < y + 1; i++) {
    ans += a[i];
  }
  printf("%lld", ans);
  ;
  printf("\n");
  ;
  return 0;
}
