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