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