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