#include <bits/stdc++.h>
using namespace std;
int v[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 cur = i;
    int anscur = 0;
    while (cur != 0) {
      anscur += v[cur % 10];
      cur /= 10;
    }
    ans += anscur;
  }
  cout << ans;
  return 0;
}
