#include <bits/stdc++.h>
using namespace std;
int counter_t = 0;
void counter(int a) {
  switch (a) {
    case 1:
      counter_t += 2;
      break;
    case 2:
      counter_t += 5;
      break;
    case 3:
      counter_t += 5;
      break;
    case 4:
      counter_t += 4;
      break;
    case 5:
      counter_t += 5;
      break;
    case 6:
      counter_t += 6;
      break;
    case 7:
      counter_t += 3;
      break;
    case 8:
      counter_t += 7;
      break;
    case 9:
      counter_t += 6;
      break;
    case 0:
      counter_t += 6;
      break;
  }
}
void numdetector(int a) {
  int m;
  while (a) {
    m = a % 10;
    counter(m);
    a = a / 10;
  }
}
int main() {
  int a, b;
  scanf("%d", &a);
  scanf("%d", &b);
  for (int i = a; i <= b; i++) {
    numdetector(i);
  }
  printf("%d", counter_t);
  return 0;
}
