#include <bits/stdc++.h>
using namespace std;
int num[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int main() {
  int i, a, b, t, res = 0;
  scanf("%d%d", &a, &b);
  for (i = a; i <= b; ++i) {
    t = i;
    while (t != 0) {
      res += num[t % 10];
      t /= 10;
    }
  }
  cout << res << '\n';
}
