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