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