#include <bits/stdc++.h>
using namespace std;
long long a, ans, b, d[11], c[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
void calc(int k) {
  while (k) {
    int p = k % 10;
    d[p]++;
    k /= 10;
  }
}
int main() {
  cin >> a >> b;
  for (int i = a; i <= b; i++) calc(i);
  for (int i = 0; i < 10; i++) ans += d[i] * c[i];
  cout << ans;
  return 0;
}
