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