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