#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int a, b;
  cin >> a >> b;
  long long int d[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}, sum = 0;
  for (int i = a; i <= b; i++) {
    int x = i, z = i;
    while (x != 0) {
      z %= 10;
      sum += d[z];
      x /= 10;
      z = x;
    }
  }
  cout << sum;
}
