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