#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m;
  while (cin >> n >> m) {
    long a[122], x, p, s = 0;
    a[0] = 6;
    a[1] = 2;
    a[2] = 5;
    a[3] = 5;
    a[4] = 4;
    a[5] = 5;
    a[6] = 6;
    a[7] = 3;
    a[8] = 7;
    a[9] = 6;
    for (int i = n; i <= m; i++) {
      x = i;
      while (x > 0) {
        p = x % 10;
        s += a[p];
        x = x / 10;
      }
    }
    cout << s << "\n";
  }
  return 0;
}
