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