#include <bits/stdc++.h>
using namespace std;
void get_each_digit(int x, int seg[], int& sum) {
  if (x >= 10) get_each_digit(x / 10, seg, sum);
  int digit = x % 10;
  sum += seg[digit];
}
int segment[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int m, n;
  cin >> n >> m;
  int sum = 0;
  for (int i = n; i <= m; i++) {
    get_each_digit(i, segment, sum);
  }
  cout << sum;
  return 0;
}
