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