#include <bits/stdc++.h>
using namespace std;
int main() {
  int start;
  int end;
  scanf("%d%d", &start, &end);
  long int sum = 0;
  for (int current = start; current <= end; current++) {
    int current_processed = current;
    while (current_processed) {
      int value = current_processed % 10;
      current_processed = current_processed / 10;
      if (value == 0) {
        sum += 6;
      }
      if (value == 1) {
        sum += 2;
      }
      if (value == 2) {
        sum += 5;
      }
      if (value == 3) {
        sum += 5;
      }
      if (value == 4) {
        sum += 4;
      }
      if (value == 5) {
        sum += 5;
      }
      if (value == 6) {
        sum += 6;
      }
      if (value == 7) {
        sum += 3;
      }
      if (value == 8) {
        sum += 7;
      }
      if (value == 9) {
        sum += 6;
      }
    }
  }
  printf("%ld\n", sum);
  return 0;
}
