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