#include <bits/stdc++.h>
using namespace std;
int a, b;
long long ans;
int main() {
  cin >> a >> b;
  for (int i = a; i <= b; i++) {
    int y = i;
    while (y != 0) {
      int u = y % 10;
      y = y / 10;
      if (u == 0) ans += 6;
      if (u == 1) ans += 2;
      if (u == 2) ans += 5;
      if (u == 3) ans += 5;
      if (u == 4) ans += 4;
      if (u == 5) ans += 5;
      if (u == 6) ans += 6;
      if (u == 7) ans += 3;
      if (u == 8) ans += 7;
      if (u == 9) ans += 6;
    }
  }
  cout << ans;
  return 0;
}
