#include <bits/stdc++.h>
using namespace std;
int main() {
  long long sum = 0;
  long long a, b;
  int arr[1000];
  arr[0] = 6;
  arr[1] = 2;
  arr[2] = 5;
  arr[3] = 5;
  arr[4] = 4;
  arr[5] = 5;
  arr[8] = 7;
  arr[9] = 6;
  arr[6] = 6;
  arr[7] = 3;
  cin >> a >> b;
  if (a == b) {
    long long g = b;
    while (g != 0) {
      int l = g % 10;
      sum += arr[l];
      g /= 10;
    }
    cout << sum;
    return 0;
  }
  for (int i = a; i <= b; i++) {
    long long z = i;
    while (z != 0) {
      int f = z % 10;
      sum += arr[f];
      z /= 10;
    }
  }
  cout << sum;
  return 0;
}
