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