#include <bits/stdc++.h>
using namespace std;
int arr[]{6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
long long get(int a) {
  long long ans = 0;
  while (a > 0) {
    ans += arr[a % 10];
    a /= 10;
  }
  return ans;
}
int main() {
  int a, b;
  cin >> a >> b;
  long long ans = 0;
  for (int i = a; i <= b; i++) {
    ans += get(i);
  }
  cout << ans << endl;
}
