#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  vector<int> k(10);
  k[0] = 6;
  k[1] = 2;
  k[2] = 5;
  k[3] = 5;
  k[4] = 4;
  k[5] = 5;
  k[6] = 6;
  k[7] = 3;
  k[8] = 7;
  k[9] = 6;
  int a, b;
  cin >> a >> b;
  int S = 0;
  for (; a <= b; a++) {
    int i = a;
    while (i > 0) {
      S += k[i % 10];
      i /= 10;
    }
  }
  cout << S;
  return 0;
}
