#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, sum = 0, n, p;
  cin >> a >> b;
  for (int i = a; i <= b; i++) {
    n = i;
    while (n > 0) {
      p = n % 10;
      if (p == 0 || p == 6 || p == 9)
        sum += 6;
      else if (p == 2 || p == 3 || p == 5)
        sum += 5;
      else if (p == 1)
        sum += 2;
      else if (p == 7)
        sum += 3;
      else if (p == 4)
        sum += 4;
      else if (p == 8)
        sum += 7;
      n = n / 10;
    }
  }
  cout << sum << endl;
}
