#include <bits/stdc++.h>
using namespace std;
int solve(int x) {
  if (x == 0 || x == 6 || x == 9) return 6;
  if (x == 5 || x == 3 || x == 2) return 5;
  if (x == 1) return 2;
  if (x == 7) return 3;
  if (x == 4) return 4;
  if (x == 8) return 7;
  return solve(x / 10) + solve(x % 10);
}
int main() {
  int l, r;
  cin >> l >> r;
  int sum = 0;
  for (int i = l; i <= r; i++) {
    sum += solve(i);
  }
  cout << sum;
}
