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