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