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