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