#include <bits/stdc++.h>
using namespace std;
constexpr int p[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int a, b, sm, total;
int main() {
  cin >> a >> b;
  for (int i = (a); i < (b + 1); i++) {
    int t = i;
    while (t) {
      int x = t % 10;
      t /= 10;
      total += p[x];
    }
  }
  return cout << total << '\n', false;
}
