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