#include <bits/stdc++.h>
using namespace std;
int i, j, k, l, m, n;
int main() {
  ios_base::sync_with_stdio;
  cin >> l >> k;
  n = 0;
  for (i = l; i <= k; i++) {
    j = i;
    while (j != 0) {
      m = j % 10;
      if (m == 0 || m == 6 || m == 9)
        n += 6;
      else if (m == 2 || m == 3 || m == 5)
        n += 5;
      else if (m == 8)
        n += 7;
      else if (m == 1)
        n += 2;
      else if (m == 4)
        n += 4;
      else
        n += 3;
      j /= 10;
    }
  }
  cout << n;
  return 0;
}
