#include <bits/stdc++.h>
using namespace std;
int x[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int a, b;
long long ans = 0;
int main(int argc, char **argv) {
  scanf("%d %d", &a, &b);
  for (int i = a; i <= b; ++i) {
    int j = i;
    while (j) {
      ans += x[j % 10];
      j /= 10;
    }
  }
  cout << ans << endl;
  return 0;
}
