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