#include <bits/stdc++.h>
using namespace std;
int c[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int a, b;
  int res = 0;
  cin >> a >> b;
  for (int i = a; i <= b; i++) {
    int tmp = i;
    while (tmp) res += c[tmp % 10], tmp /= 10;
  }
  cout << res;
  return 0;
}
